aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/zwobble
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/zwobble')
-rw-r--r--src/main/java/org/zwobble/couscous/ast/AnnotationNode.java47
1 files changed, 43 insertions, 4 deletions
diff --git a/src/main/java/org/zwobble/couscous/ast/AnnotationNode.java b/src/main/java/org/zwobble/couscous/ast/AnnotationNode.java
index 1f34126..f7a646b 100644
--- a/src/main/java/org/zwobble/couscous/ast/AnnotationNode.java
+++ b/src/main/java/org/zwobble/couscous/ast/AnnotationNode.java
@@ -1,8 +1,47 @@
package org.zwobble.couscous.ast;
-import lombok.Value;
-
-@Value(staticConstructor="annotation")
public class AnnotationNode {
- TypeName type;
+ public static AnnotationNode annotation(TypeName type) {
+ return new AnnotationNode(type);
+ }
+
+ private final TypeName type;
+
+ private AnnotationNode(TypeName type) {
+ this.type = type;
+ }
+
+ public TypeName getType() {
+ return type;
+ }
+
+ @Override
+ public String toString() {
+ return "AnnotationNode(type=" + type + ")";
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((type == null) ? 0 : type.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ AnnotationNode other = (AnnotationNode) obj;
+ if (type == null) {
+ if (other.type != null)
+ return false;
+ } else if (!type.equals(other.type))
+ return false;
+ return true;
+ }
}