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 class
WXM1Comment.Builder
Builds instances of typeWXM1Comment
. -
Method Summary
Modifier and Type Method Description static WXM1Comment.Builder
builder()
Creates a builder forWXM1Comment
.static WXM1Comment
copyOf(WXM1CommentType instance)
Creates an immutable copy of aWXM1CommentType
value.boolean
equals(java.lang.Object another)
This instance is equal to all instances ofWXM1Comment
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:text
.static WXM1Comment
of(java.lang.String text)
Construct a new immutableWXM1Comment
instance.java.lang.String
text()
java.lang.String
toString()
Prints the immutable valueWXM1Comment
with attribute values.WXM1Comment
withText(java.lang.String value)
Copy the current immutable object by setting a value for thetext
attribute.
-
Method Details
-
text
public java.lang.String text()- Specified by:
text
in interfaceWXM1CommentType
- Returns:
- The value of the
text
attribute
-
withText
Copy the current immutable object by setting a value for thetext
attribute. 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
this
object
-
equals
public boolean equals(java.lang.Object another)This instance is equal to all instances ofWXM1Comment
that have equal attribute values.- Overrides:
equals
in classjava.lang.Object
- Returns:
true
ifthis
is equal toanother
instance
-
hashCode
public int hashCode()Computes a hash code from attributes:text
.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- hashCode value
-
toString
public java.lang.String toString()Prints the immutable valueWXM1Comment
with attribute values.- Overrides:
toString
in classjava.lang.Object
- Returns:
- A string representation of the value
-
of
Construct a new immutableWXM1Comment
instance.- Parameters:
text
- The value for thetext
attribute- Returns:
- An immutable WXM1Comment instance
-
copyOf
Creates an immutable copy of aWXM1CommentType
value. 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) // required
text
.build();- Returns:
- A new WXM1Comment builder
-