From 429fe412cc6b0cc2ebf6f6c3bd3339b1779bf738 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sun, 25 Oct 2015 11:13:14 +0000 Subject: Remove lombok from AnnotationNode --- .../org/zwobble/couscous/ast/AnnotationNode.java | 47 ++++++++++++++++++++-- 1 file changed, 43 insertions(+), 4 deletions(-) (limited to 'src/main/java') 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; + } } -- cgit v1.2.3