Package com.io7m.waxmill.machines
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().
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classWXMTTYBackendFile.BuilderBuilds instances of typeWXMTTYBackendFile.Nested classes/interfaces inherited from interface com.io7m.waxmill.machines.WXMDeviceType.WXMTTYBackendType
WXMDeviceType.WXMTTYBackendType.Kind -
Method Summary
Modifier and Type Method Description static WXMTTYBackendFile.Builderbuilder()Creates a builder forWXMTTYBackendFile.java.lang.Stringcomment()static WXMTTYBackendFilecopyOf(WXMDeviceType.WXMTTYBackendFileType instance)Creates an immutable copy of aWXMDeviceType.WXMTTYBackendFileTypevalue.java.lang.Stringdevice()booleanequals(java.lang.Object another)This instance is equal to all instances ofWXMTTYBackendFilethat have equal attribute values.inthashCode()Computes a hash code from attributes:path,device,comment.java.nio.file.Pathpath()java.lang.StringtoString()Prints the immutable valueWXMTTYBackendFilewith attribute values.WXMTTYBackendFilewithComment(java.lang.String value)Copy the current immutable object by setting a value for thecommentattribute.WXMTTYBackendFilewithDevice(java.lang.String value)Copy the current immutable object by setting a value for thedeviceattribute.WXMTTYBackendFilewithPath(java.nio.file.Path value)Copy the current immutable object by setting a value for thepathattribute.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.io7m.waxmill.machines.WXMDeviceType.WXMTTYBackendFileType
checkPreconditions, kind
-
Method Details
-
path
public java.nio.file.Path path()- Specified by:
pathin interfaceWXMDeviceType.WXMTTYBackendFileType- Returns:
- The value of the
pathattribute
-
device
public java.lang.String device()- Specified by:
devicein interfaceWXMDeviceType.WXMTTYBackendFileType- Specified by:
devicein interfaceWXMDeviceType.WXMTTYBackendType- Returns:
- The value of the
deviceattribute
-
comment
public java.lang.String comment()- Specified by:
commentin interfaceWXMDeviceType.WXMTTYBackendFileType- Specified by:
commentin interfaceWXMDeviceType.WXMTTYBackendType- Returns:
- The value of the
commentattribute
-
withPath
Copy the current immutable object by setting a value for thepathattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for path- Returns:
- A modified copy of the
thisobject
-
withDevice
Copy the current immutable object by setting a value for thedeviceattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for device- Returns:
- A modified copy of the
thisobject
-
withComment
Copy the current immutable object by setting a value for thecommentattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for comment- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(java.lang.Object another)This instance is equal to all instances ofWXMTTYBackendFilethat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()Computes a hash code from attributes:path,device,comment.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()Prints the immutable valueWXMTTYBackendFilewith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
copyOf
Creates an immutable copy of aWXMDeviceType.WXMTTYBackendFileTypevalue. 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
Creates a builder forWXMTTYBackendFile.WXMTTYBackendFile.builder() .setPath(java.nio.file.Path) // requiredpath.setDevice(String) // requireddevice.setComment(String) // optionalcomment.build();- Returns:
- A new WXMTTYBackendFile builder
-