Package com.io7m.waxmill.xml.vm.v1
Class WXM1Comment
java.lang.Object
com.io7m.waxmill.xml.vm.v1.WXM1Comment
- All Implemented Interfaces:
WXM1CommentType
public final class WXM1Comment extends java.lang.Object implements WXM1CommentType
Immutable implementation of
WXM1CommentType.
Use the builder to create immutable instances:
WXM1Comment.builder().
Use the static factory method to create immutable instances:
WXM1Comment.of().
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classWXM1Comment.BuilderBuilds instances of typeWXM1Comment. -
Method Summary
Modifier and Type Method Description static WXM1Comment.Builderbuilder()Creates a builder forWXM1Comment.static WXM1CommentcopyOf(WXM1CommentType instance)Creates an immutable copy of aWXM1CommentTypevalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofWXM1Commentthat have equal attribute values.inthashCode()Computes a hash code from attributes:text.static WXM1Commentof(java.lang.String text)Construct a new immutableWXM1Commentinstance.java.lang.Stringtext()java.lang.StringtoString()Prints the immutable valueWXM1Commentwith attribute values.WXM1CommentwithText(java.lang.String value)Copy the current immutable object by setting a value for thetextattribute.
-
Method Details
-
text
public java.lang.String text()- Specified by:
textin interfaceWXM1CommentType- Returns:
- The value of the
textattribute
-
withText
Copy the current immutable object by setting a value for thetextattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for text- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(java.lang.Object another)This instance is equal to all instances ofWXM1Commentthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()Computes a hash code from attributes:text.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()Prints the immutable valueWXM1Commentwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
of
Construct a new immutableWXM1Commentinstance.- Parameters:
text- The value for thetextattribute- Returns:
- An immutable WXM1Comment instance
-
copyOf
Creates an immutable copy of aWXM1CommentTypevalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance- The instance to copy- Returns:
- A copied immutable WXM1Comment instance
-
builder
Creates a builder forWXM1Comment.WXM1Comment.builder() .setText(String) // requiredtext.build();- Returns:
- A new WXM1Comment builder
-