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