From 8bca475f4f51c7ab1424c6315dee2278514cbe5e Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sun, 25 Oct 2015 18:12:18 +0000 Subject: Remove lombok from FieldDeclarationNode --- .../zwobble/couscous/ast/FieldDeclarationNode.java | 60 ++++++++++++++++++++-- 1 file changed, 55 insertions(+), 5 deletions(-) (limited to 'src/main/java/org') diff --git a/src/main/java/org/zwobble/couscous/ast/FieldDeclarationNode.java b/src/main/java/org/zwobble/couscous/ast/FieldDeclarationNode.java index 49a45d3..58b05f2 100644 --- a/src/main/java/org/zwobble/couscous/ast/FieldDeclarationNode.java +++ b/src/main/java/org/zwobble/couscous/ast/FieldDeclarationNode.java @@ -1,9 +1,59 @@ package org.zwobble.couscous.ast; -import lombok.Value; - -@Value(staticConstructor="field") public class FieldDeclarationNode { - String name; - TypeName type; + public static FieldDeclarationNode field(String name, TypeName type) { + return new FieldDeclarationNode(name, type); + } + + private final String name; + private final TypeName type; + + private FieldDeclarationNode(String name, TypeName type) { + this.name = name; + this.type = type; + } + + public String getName() { + return name; + } + + public TypeName getType() { + return type; + } + + @Override + public String toString() { + return "FieldDeclarationNode(name=" + name + ", type=" + type + ")"; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((name == null) ? 0 : name.hashCode()); + 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; + FieldDeclarationNode other = (FieldDeclarationNode) obj; + if (name == null) { + if (other.name != null) + return false; + } else if (!name.equals(other.name)) + return false; + if (type == null) { + if (other.type != null) + return false; + } else if (!type.equals(other.type)) + return false; + return true; + } } -- cgit v1.2.3