Package com.io7m.waxmill.machines
Class WXMStorageBackendFile
java.lang.Object
com.io7m.waxmill.machines.WXMStorageBackendFile
- All Implemented Interfaces:
WXMDeviceType.WXMStorageBackendFileType,WXMDeviceType.WXMStorageBackendType
public final class WXMStorageBackendFile extends java.lang.Object implements WXMDeviceType.WXMStorageBackendFileType
Immutable implementation of
WXMDeviceType.WXMStorageBackendFileType.
Use the builder to create immutable instances:
WXMStorageBackendFile.builder().
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classWXMStorageBackendFile.BuilderBuilds instances of typeWXMStorageBackendFile.Nested classes/interfaces inherited from interface com.io7m.waxmill.machines.WXMDeviceType.WXMStorageBackendType
WXMDeviceType.WXMStorageBackendType.Kind -
Method Summary
Modifier and Type Method Description static WXMStorageBackendFile.Builderbuilder()Creates a builder forWXMStorageBackendFile.java.lang.Stringcomment()static WXMStorageBackendFilecopyOf(WXMDeviceType.WXMStorageBackendFileType instance)Creates an immutable copy of aWXMDeviceType.WXMStorageBackendFileTypevalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofWXMStorageBackendFilethat have equal attribute values.java.nio.file.Pathfile()inthashCode()Computes a hash code from attributes:file,options,sectorSizes,comment.java.util.Set<WXMOpenOption>options()java.util.Optional<WXMSectorSizes>sectorSizes()java.lang.StringtoString()Prints the immutable valueWXMStorageBackendFilewith attribute values.WXMStorageBackendFilewithComment(java.lang.String value)Copy the current immutable object by setting a value for thecommentattribute.WXMStorageBackendFilewithFile(java.nio.file.Path value)Copy the current immutable object by setting a value for thefileattribute.WXMStorageBackendFilewithOptions(WXMOpenOption... elements)Copy the current immutable object with elements that replace the content ofoptions.WXMStorageBackendFilewithOptions(java.lang.Iterable<WXMOpenOption> elements)Copy the current immutable object with elements that replace the content ofoptions.WXMStorageBackendFilewithSectorSizes(WXMSectorSizes value)Copy the current immutable object by setting a present value for the optionalsectorSizesattribute.WXMStorageBackendFilewithSectorSizes(java.util.Optional<? extends WXMSectorSizes> optional)Copy the current immutable object by setting an optional value for thesectorSizesattribute.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.io7m.waxmill.machines.WXMDeviceType.WXMStorageBackendFileType
checkPreconditions, kind
-
Method Details
-
file
public java.nio.file.Path file()- Specified by:
filein interfaceWXMDeviceType.WXMStorageBackendFileType- Returns:
- The value of the
fileattribute
-
options
- Specified by:
optionsin interfaceWXMDeviceType.WXMStorageBackendFileType- Returns:
- The value of the
optionsattribute
-
sectorSizes
- Specified by:
sectorSizesin interfaceWXMDeviceType.WXMStorageBackendFileType- Returns:
- The value of the
sectorSizesattribute
-
comment
public java.lang.String comment()- Specified by:
commentin interfaceWXMDeviceType.WXMStorageBackendFileType- Specified by:
commentin interfaceWXMDeviceType.WXMStorageBackendType- Returns:
- The value of the
commentattribute
-
withFile
Copy the current immutable object by setting a value for thefileattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for file- Returns:
- A modified copy of the
thisobject
-
withOptions
Copy the current immutable object with elements that replace the content ofoptions.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withOptions
Copy the current immutable object with elements that replace the content ofoptions. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of options elements to set- Returns:
- A modified copy of
thisobject
-
withSectorSizes
Copy the current immutable object by setting a present value for the optionalsectorSizesattribute.- Parameters:
value- The value for sectorSizes- Returns:
- A modified copy of
thisobject
-
withSectorSizes
public final WXMStorageBackendFile withSectorSizes(java.util.Optional<? extends WXMSectorSizes> optional)Copy the current immutable object by setting an optional value for thesectorSizesattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for sectorSizes- Returns:
- A modified copy of
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 ofWXMStorageBackendFilethat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()Computes a hash code from attributes:file,options,sectorSizes,comment.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()Prints the immutable valueWXMStorageBackendFilewith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
copyOf
Creates an immutable copy of aWXMDeviceType.WXMStorageBackendFileTypevalue. 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 WXMStorageBackendFile instance
-
builder
Creates a builder forWXMStorageBackendFile.WXMStorageBackendFile.builder() .setFile(java.nio.file.Path) // requiredfile.addOptions|addAllOptions(com.io7m.waxmill.machines.WXMOpenOption) //optionselements .setSectorSizes(WXMSectorSizes) // optionalsectorSizes.setComment(String) // optionalcomment.build();- Returns:
- A new WXMStorageBackendFile builder
-