diff options
Diffstat (limited to 'container-compiler-plugin/src/main/java/io/trygvis/container/compiler/model/FieldRef.java')
-rw-r--r-- | container-compiler-plugin/src/main/java/io/trygvis/container/compiler/model/FieldRef.java | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/container-compiler-plugin/src/main/java/io/trygvis/container/compiler/model/FieldRef.java b/container-compiler-plugin/src/main/java/io/trygvis/container/compiler/model/FieldRef.java new file mode 100644 index 0000000..29a2c51 --- /dev/null +++ b/container-compiler-plugin/src/main/java/io/trygvis/container/compiler/model/FieldRef.java @@ -0,0 +1,31 @@ +package io.trygvis.container.compiler.model; + +public class FieldRef implements Comparable<FieldRef> { + public final TypeRef klass; + public final String name; + + public FieldRef(TypeRef klass, String name) { + this.klass = klass; + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (!(o instanceof FieldRef)) return false; + + FieldRef fieldRef = (FieldRef) o; + + return name.equals(fieldRef.name); + } + + @Override + public int hashCode() { + return name.hashCode(); + } + + @Override + public int compareTo(FieldRef o) { + return name.compareTo(o.name); + } +} |