diff options
| author | Michael Williamson <mike@zwobble.org> | 2016-07-15 23:14:08 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2016-07-15 23:20:03 +0100 |
| commit | d995649e3bab94002b439aebcc93e7d3f16b13fc (patch) | |
| tree | 5ddc0b1e224e8bda7201b621e089e8f3a8f7f6b8 /src/main/java/org/zwobble/couscous/ast/identifiers/IdentifierPart.java | |
| parent | 9a032e3bda13169959e5022ca21e7f160edf351f (diff) | |
Remove Identifiers in favour of instance methods
Diffstat (limited to 'src/main/java/org/zwobble/couscous/ast/identifiers/IdentifierPart.java')
| -rw-r--r-- | src/main/java/org/zwobble/couscous/ast/identifiers/IdentifierPart.java | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/main/java/org/zwobble/couscous/ast/identifiers/IdentifierPart.java b/src/main/java/org/zwobble/couscous/ast/identifiers/IdentifierPart.java index 5aedcf0..ef1f83c 100644 --- a/src/main/java/org/zwobble/couscous/ast/identifiers/IdentifierPart.java +++ b/src/main/java/org/zwobble/couscous/ast/identifiers/IdentifierPart.java @@ -16,4 +16,31 @@ public class IdentifierPart { public IdentifierType getType() { return type; } + + @Override + public String toString() { + return "IdentifierPart(" + + "name='" + name + '\'' + + ", type=" + type + + ')'; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + IdentifierPart that = (IdentifierPart) o; + + if (!name.equals(that.name)) return false; + return type == that.type; + + } + + @Override + public int hashCode() { + int result = name.hashCode(); + result = 31 * result + type.hashCode(); + return result; + } } |
