Class WXMTTYBackendFile

java.lang.Object
com.io7m.waxmill.machines.WXMTTYBackendFile
All Implemented Interfaces:
WXMDeviceType.WXMTTYBackendFileType, WXMDeviceType.WXMTTYBackendType

public final class WXMTTYBackendFile
extends java.lang.Object
implements WXMDeviceType.WXMTTYBackendFileType
Immutable implementation of WXMDeviceType.WXMTTYBackendFileType.

Use the builder to create immutable instances: WXMTTYBackendFile.builder().

  • Method Details

    • path

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

      public java.lang.String device()
      Specified by:
      device in interface WXMDeviceType.WXMTTYBackendFileType
      Specified by:
      device in interface WXMDeviceType.WXMTTYBackendType
      Returns:
      The value of the device attribute
    • comment

      public java.lang.String comment()
      Specified by:
      comment in interface WXMDeviceType.WXMTTYBackendFileType
      Specified by:
      comment in interface WXMDeviceType.WXMTTYBackendType
      Returns:
      The value of the comment attribute
    • withPath

      public final WXMTTYBackendFile 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
    • withDevice

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

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

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

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

      public static WXMTTYBackendFile copyOf​(WXMDeviceType.WXMTTYBackendFileType instance)
      Creates an immutable copy of a WXMDeviceType.WXMTTYBackendFileType 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 WXMTTYBackendFile instance
    • builder

      public static WXMTTYBackendFile.Builder builder()
      Creates a builder for WXMTTYBackendFile.
       WXMTTYBackendFile.builder()
          .setPath(java.nio.file.Path) // required path
          .setDevice(String) // required device
          .setComment(String) // optional comment
          .build();
       
      Returns:
      A new WXMTTYBackendFile builder