aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/zwobble/mammoth/xml/XmlTextNode.java
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2015-10-25 20:59:42 +0000
committerMichael Williamson <mike@zwobble.org>2015-10-25 20:59:42 +0000
commita7467ecfcda9bf6e2f67c74fdddca290d27d9da6 (patch)
treef66114d21a0b2ee6832b1d473e3f68c8a0ec06b5 /src/main/java/org/zwobble/mammoth/xml/XmlTextNode.java
parent84c1a42a0cdb36fbf5c6b2653a872c230bfe16f3 (diff)
Remove lombok
Diffstat (limited to 'src/main/java/org/zwobble/mammoth/xml/XmlTextNode.java')
-rw-r--r--src/main/java/org/zwobble/mammoth/xml/XmlTextNode.java43
1 files changed, 39 insertions, 4 deletions
diff --git a/src/main/java/org/zwobble/mammoth/xml/XmlTextNode.java b/src/main/java/org/zwobble/mammoth/xml/XmlTextNode.java
index 4d47626..1dd0275 100644
--- a/src/main/java/org/zwobble/mammoth/xml/XmlTextNode.java
+++ b/src/main/java/org/zwobble/mammoth/xml/XmlTextNode.java
@@ -1,13 +1,48 @@
package org.zwobble.mammoth.xml;
-import lombok.Value;
-
-@Value
public class XmlTextNode implements XmlNode {
- private String value;
+ private final String value;
+ public XmlTextNode(String value) {
+ this.value = value;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
@Override
public <T> T accept(XmlNodeVisitor<T> visitor) {
return visitor.Visit(this);
}
+
+ @Override
+ public String toString() {
+ return "XmlTextNode(value=" + value + ")";
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((value == null) ? 0 : value.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;
+ XmlTextNode other = (XmlTextNode) obj;
+ if (value == null) {
+ if (other.value != null)
+ return false;
+ } else if (!value.equals(other.value))
+ return false;
+ return true;
+ }
}