aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2015-10-25 18:01:07 +0000
committerMichael Williamson <mike@zwobble.org>2015-10-25 18:01:07 +0000
commit0a5d0177a34713c968f16f31478bea88767a9f79 (patch)
tree3b6ca3a19dafcd5f12537c3e4627ddc907a2266f /src/main/java
parent2fe122bedcf87e2317ec53d351116ade43c09336 (diff)
Remove lombok from ConstructorCallNode
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/org/zwobble/couscous/ast/ConstructorCallNode.java67
1 files changed, 62 insertions, 5 deletions
diff --git a/src/main/java/org/zwobble/couscous/ast/ConstructorCallNode.java b/src/main/java/org/zwobble/couscous/ast/ConstructorCallNode.java
index 2aecc6c..6a4655a 100644
--- a/src/main/java/org/zwobble/couscous/ast/ConstructorCallNode.java
+++ b/src/main/java/org/zwobble/couscous/ast/ConstructorCallNode.java
@@ -4,15 +4,72 @@ import java.util.List;
import org.zwobble.couscous.ast.visitors.ExpressionNodeMapper;
-import lombok.Value;
-
-@Value(staticConstructor="constructorCall")
public class ConstructorCallNode implements ExpressionNode {
- TypeName type;
- List<ExpressionNode> arguments;
+ public static ConstructorCallNode constructorCall(
+ TypeName type,
+ List<ExpressionNode> arguments) {
+ return new ConstructorCallNode(type, arguments);
+ }
+
+ private final TypeName type;
+ private final List<ExpressionNode> arguments;
+
+ public ConstructorCallNode(
+ TypeName type,
+ List<ExpressionNode> arguments) {
+ this.type = type;
+ this.arguments = arguments;
+ }
+
+ @Override
+ public TypeName getType() {
+ return type;
+ }
+
+ public List<ExpressionNode> getArguments() {
+ return arguments;
+ }
@Override
public <T> T accept(ExpressionNodeMapper<T> visitor) {
return visitor.visit(this);
}
+
+ @Override
+ public String toString() {
+ return "ConstructorCallNode(type=" + type + ", arguments=" + arguments
+ + ")";
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result
+ + ((arguments == null) ? 0 : arguments.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;
+ ConstructorCallNode other = (ConstructorCallNode) obj;
+ if (arguments == null) {
+ if (other.arguments != null)
+ return false;
+ } else if (!arguments.equals(other.arguments))
+ return false;
+ if (type == null) {
+ if (other.type != null)
+ return false;
+ } else if (!type.equals(other.type))
+ return false;
+ return true;
+ }
}