Package com.io7m.waxmill.machines
Class WXMStorageBackendZFSVolume
java.lang.Object
com.io7m.waxmill.machines.WXMStorageBackendZFSVolume
- All Implemented Interfaces:
WXMDeviceType.WXMStorageBackendType,WXMDeviceType.WXMStorageBackendZFSVolumeType
public final class WXMStorageBackendZFSVolume extends java.lang.Object implements WXMDeviceType.WXMStorageBackendZFSVolumeType
Immutable implementation of
WXMDeviceType.WXMStorageBackendZFSVolumeType.
Use the builder to create immutable instances:
WXMStorageBackendZFSVolume.builder().
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classWXMStorageBackendZFSVolume.BuilderBuilds instances of typeWXMStorageBackendZFSVolume.Nested classes/interfaces inherited from interface com.io7m.waxmill.machines.WXMDeviceType.WXMStorageBackendType
WXMDeviceType.WXMStorageBackendType.Kind -
Method Summary
Modifier and Type Method Description static WXMStorageBackendZFSVolume.Builderbuilder()Creates a builder forWXMStorageBackendZFSVolume.java.lang.Stringcomment()static WXMStorageBackendZFSVolumecopyOf(WXMDeviceType.WXMStorageBackendZFSVolumeType instance)Creates an immutable copy of aWXMDeviceType.WXMStorageBackendZFSVolumeTypevalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofWXMStorageBackendZFSVolumethat have equal attribute values.java.util.Optional<java.math.BigInteger>expectedSize()inthashCode()Computes a hash code from attributes:comment,expectedSize.java.lang.StringtoString()Prints the immutable valueWXMStorageBackendZFSVolumewith attribute values.WXMStorageBackendZFSVolumewithComment(java.lang.String value)Copy the current immutable object by setting a value for thecommentattribute.WXMStorageBackendZFSVolumewithExpectedSize(java.math.BigInteger value)Copy the current immutable object by setting a present value for the optionalexpectedSizeattribute.WXMStorageBackendZFSVolumewithExpectedSize(java.util.Optional<? extends java.math.BigInteger> optional)Copy the current immutable object by setting an optional value for theexpectedSizeattribute.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.io7m.waxmill.machines.WXMDeviceType.WXMStorageBackendZFSVolumeType
checkPreconditions, kind
-
Method Details
-
comment
public java.lang.String comment()- Specified by:
commentin interfaceWXMDeviceType.WXMStorageBackendType- Specified by:
commentin interfaceWXMDeviceType.WXMStorageBackendZFSVolumeType- Returns:
- The value of the
commentattribute
-
expectedSize
public java.util.Optional<java.math.BigInteger> expectedSize()- Specified by:
expectedSizein interfaceWXMDeviceType.WXMStorageBackendZFSVolumeType- Returns:
- The expected size, in bytes, of the ZFS volume
-
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
-
withExpectedSize
Copy the current immutable object by setting a present value for the optionalexpectedSizeattribute.- Parameters:
value- The value for expectedSize- Returns:
- A modified copy of
thisobject
-
withExpectedSize
public final WXMStorageBackendZFSVolume withExpectedSize(java.util.Optional<? extends java.math.BigInteger> optional)Copy the current immutable object by setting an optional value for theexpectedSizeattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for expectedSize- Returns:
- A modified copy of
thisobject
-
equals
public boolean equals(java.lang.Object another)This instance is equal to all instances ofWXMStorageBackendZFSVolumethat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()Computes a hash code from attributes:comment,expectedSize.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()Prints the immutable valueWXMStorageBackendZFSVolumewith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
copyOf
public static WXMStorageBackendZFSVolume copyOf(WXMDeviceType.WXMStorageBackendZFSVolumeType instance)Creates an immutable copy of aWXMDeviceType.WXMStorageBackendZFSVolumeTypevalue. 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 WXMStorageBackendZFSVolume instance
-
builder
Creates a builder forWXMStorageBackendZFSVolume.WXMStorageBackendZFSVolume.builder() .setComment(String) // optionalcomment.setExpectedSize(java.math.BigInteger) // optionalexpectedSize.build();- Returns:
- A new WXMStorageBackendZFSVolume builder
-