Package com.io7m.waxmill.xml.vm.v1
Class WXM1Flag
java.lang.Object
com.io7m.waxmill.xml.vm.v1.WXM1Flag
- All Implemented Interfaces:
WXM1FlagType
public final class WXM1Flag extends java.lang.Object implements WXM1FlagType
Immutable implementation of
WXM1FlagType.
Use the builder to create immutable instances:
WXM1Flag.builder().
Use the static factory method to create immutable instances:
WXM1Flag.of().
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classWXM1Flag.BuilderBuilds instances of typeWXM1Flag. -
Method Summary
Modifier and Type Method Description static WXM1Flag.Builderbuilder()Creates a builder forWXM1Flag.static WXM1FlagcopyOf(WXM1FlagType instance)Creates an immutable copy of aWXM1FlagTypevalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofWXM1Flagthat have equal attribute values.inthashCode()Computes a hash code from attributes:name,value.java.lang.Stringname()static WXM1Flagof(java.lang.String name, boolean value)Construct a new immutableWXM1Flaginstance.java.lang.StringtoString()Prints the immutable valueWXM1Flagwith attribute values.booleanvalue()WXM1FlagwithName(java.lang.String value)Copy the current immutable object by setting a value for thenameattribute.WXM1FlagwithValue(boolean value)Copy the current immutable object by setting a value for thevalueattribute.
-
Method Details
-
name
public java.lang.String name()- Specified by:
namein interfaceWXM1FlagType- Returns:
- The value of the
nameattribute
-
value
public boolean value()- Specified by:
valuein interfaceWXM1FlagType- Returns:
- The value of the
valueattribute
-
withName
Copy the current immutable object by setting a value for thenameattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for name- Returns:
- A modified copy of the
thisobject
-
withValue
Copy the current immutable object by setting a value for thevalueattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for value- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(java.lang.Object another)This instance is equal to all instances ofWXM1Flagthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()Computes a hash code from attributes:name,value.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()Prints the immutable valueWXM1Flagwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
of
Construct a new immutableWXM1Flaginstance.- Parameters:
name- The value for thenameattributevalue- The value for thevalueattribute- Returns:
- An immutable WXM1Flag instance
-
copyOf
Creates an immutable copy of aWXM1FlagTypevalue. 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 WXM1Flag instance
-
builder
Creates a builder forWXM1Flag.WXM1Flag.builder() .setName(String) // requiredname.setValue(boolean) // requiredvalue.build();- Returns:
- A new WXM1Flag builder
-