diff options
Diffstat (limited to 'src/main/java/org/zwobble/mammoth/xml/XmlTextNode.java')
| -rw-r--r-- | src/main/java/org/zwobble/mammoth/xml/XmlTextNode.java | 43 |
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; + } } |
