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 class  WXM1Flag.Builder
    Builds instances of type WXM1Flag.
  • Method Summary

    Modifier and Type Method Description
    static WXM1Flag.Builder builder()
    Creates a builder for WXM1Flag.
    static WXM1Flag copyOf​(WXM1FlagType instance)
    Creates an immutable copy of a WXM1FlagType value.
    boolean equals​(java.lang.Object another)
    This instance is equal to all instances of WXM1Flag that have equal attribute values.
    int hashCode()
    Computes a hash code from attributes: name, value.
    java.lang.String name()  
    static WXM1Flag of​(java.lang.String name, boolean value)
    Construct a new immutable WXM1Flag instance.
    java.lang.String toString()
    Prints the immutable value WXM1Flag with attribute values.
    boolean value()  
    WXM1Flag withName​(java.lang.String value)
    Copy the current immutable object by setting a value for the name attribute.
    WXM1Flag withValue​(boolean value)
    Copy the current immutable object by setting a value for the value attribute.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Method Details

    • name

      public java.lang.String name()
      Specified by:
      name in interface WXM1FlagType
      Returns:
      The value of the name attribute
    • value

      public boolean value()
      Specified by:
      value in interface WXM1FlagType
      Returns:
      The value of the value attribute
    • withName

      public final WXM1Flag withName​(java.lang.String value)
      Copy the current immutable object by setting a value for the name attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for name
      Returns:
      A modified copy of the this object
    • withValue

      public final WXM1Flag withValue​(boolean value)
      Copy the current immutable object by setting a value for the value attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for value
      Returns:
      A modified copy of the this object
    • equals

      public boolean equals​(java.lang.Object another)
      This instance is equal to all instances of WXM1Flag that have equal attribute values.
      Overrides:
      equals in class java.lang.Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: name, value.
      Overrides:
      hashCode in class java.lang.Object
      Returns:
      hashCode value
    • toString

      public java.lang.String toString()
      Prints the immutable value WXM1Flag with attribute values.
      Overrides:
      toString in class java.lang.Object
      Returns:
      A string representation of the value
    • of

      public static WXM1Flag of​(java.lang.String name, boolean value)
      Construct a new immutable WXM1Flag instance.
      Parameters:
      name - The value for the name attribute
      value - The value for the value attribute
      Returns:
      An immutable WXM1Flag instance
    • copyOf

      public static WXM1Flag copyOf​(WXM1FlagType instance)
      Creates an immutable copy of a WXM1FlagType 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 WXM1Flag instance
    • builder

      public static WXM1Flag.Builder builder()
      Creates a builder for WXM1Flag.
       WXM1Flag.builder()
          .setName(String) // required name
          .setValue(boolean) // required value
          .build();
       
      Returns:
      A new WXM1Flag builder