Class WXM1Path

java.lang.Object
com.io7m.waxmill.xml.config.v1.WXM1Path
All Implemented Interfaces:
WXM1PathType

public final class WXM1Path
extends java.lang.Object
implements WXM1PathType
Immutable implementation of WXM1PathType.

Use the builder to create immutable instances: WXM1Path.builder(). Use the static factory method to create immutable instances: WXM1Path.of().

  • Nested Class Summary

    Nested Classes 
    Modifier and Type Class Description
    static class  WXM1Path.Builder
    Builds instances of type WXM1Path.
  • Method Summary

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

    Methods inherited from class java.lang.Object

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

    • type

      public java.lang.String type()
      Specified by:
      type in interface WXM1PathType
      Returns:
      The value of the type attribute
    • path

      public java.nio.file.Path path()
      Specified by:
      path in interface WXM1PathType
      Returns:
      The value of the path attribute
    • withType

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

      public final WXM1Path withPath​(java.nio.file.Path value)
      Copy the current immutable object by setting a value for the path attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for path
      Returns:
      A modified copy of the this object
    • equals

      public boolean equals​(java.lang.Object another)
      This instance is equal to all instances of WXM1Path 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: type, path.
      Overrides:
      hashCode in class java.lang.Object
      Returns:
      hashCode value
    • toString

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

      public static WXM1Path of​(java.lang.String type, java.nio.file.Path path)
      Construct a new immutable WXM1Path instance.
      Parameters:
      type - The value for the type attribute
      path - The value for the path attribute
      Returns:
      An immutable WXM1Path instance
    • copyOf

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

      public static WXM1Path.Builder builder()
      Creates a builder for WXM1Path.
       WXM1Path.builder()
          .setType(String) // required type
          .setPath(java.nio.file.Path) // required path
          .build();
       
      Returns:
      A new WXM1Path builder