diff options
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; + } } |
