| 1 | package uk.co.zonetora.fj.model; |
| 2 | |
| 3 | public class MethodName { |
| 4 | |
| 5 | //Newtype String methName |
| 6 | private final String methName; |
| 7 | |
| 8 | public MethodName(String methName) { |
| 9 | if (methName == null) { |
| 10 | throw new IllegalArgumentException("methName cannot be null!"); |
| 11 | } |
| 12 | this.methName = methName.intern(); |
| 13 | } |
| 14 | |
| 15 | public String getmethName() { |
| 16 | return this.methName; |
| 17 | } |
| 18 | |
| 19 | @Override |
| 20 | public boolean equals(Object other) { |
| 21 | if (this == other) { |
| 22 | return true; |
| 23 | } |
| 24 | |
| 25 | if (other instanceof MethodName) { |
| 26 | MethodName othr = (MethodName) other; |
| 27 | return othr.methName.equals(this.methName); |
| 28 | } |
| 29 | return false; |
| 30 | } |
| 31 | |
| 32 | @Override |
| 33 | public int hashCode() { |
| 34 | return methName.hashCode(); |
| 35 | } |
| 36 | } |