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 class
WXMStorageBackendZFSVolume.Builder
Builds 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.Builder
builder()
Creates a builder forWXMStorageBackendZFSVolume
.java.lang.String
comment()
static WXMStorageBackendZFSVolume
copyOf(WXMDeviceType.WXMStorageBackendZFSVolumeType instance)
Creates an immutable copy of aWXMDeviceType.WXMStorageBackendZFSVolumeType
value.boolean
equals(java.lang.Object another)
This instance is equal to all instances ofWXMStorageBackendZFSVolume
that have equal attribute values.java.util.Optional<java.math.BigInteger>
expectedSize()
int
hashCode()
Computes a hash code from attributes:comment
,expectedSize
.java.lang.String
toString()
Prints the immutable valueWXMStorageBackendZFSVolume
with attribute values.WXMStorageBackendZFSVolume
withComment(java.lang.String value)
Copy the current immutable object by setting a value for thecomment
attribute.WXMStorageBackendZFSVolume
withExpectedSize(java.math.BigInteger value)
Copy the current immutable object by setting a present value for the optionalexpectedSize
attribute.WXMStorageBackendZFSVolume
withExpectedSize(java.util.Optional<? extends java.math.BigInteger> optional)
Copy the current immutable object by setting an optional value for theexpectedSize
attribute.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.io7m.waxmill.machines.WXMDeviceType.WXMStorageBackendZFSVolumeType
checkPreconditions, kind
-
Method Details
-
comment
public java.lang.String comment()- Specified by:
comment
in interfaceWXMDeviceType.WXMStorageBackendType
- Specified by:
comment
in interfaceWXMDeviceType.WXMStorageBackendZFSVolumeType
- Returns:
- The value of the
comment
attribute
-
expectedSize
public java.util.Optional<java.math.BigInteger> expectedSize()- Specified by:
expectedSize
in interfaceWXMDeviceType.WXMStorageBackendZFSVolumeType
- Returns:
- The expected size, in bytes, of the ZFS volume
-
withComment
Copy the current immutable object by setting a value for thecomment
attribute. 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
this
object
-
withExpectedSize
Copy the current immutable object by setting a present value for the optionalexpectedSize
attribute.- Parameters:
value
- The value for expectedSize- Returns:
- A modified copy of
this
object
-
withExpectedSize
public final WXMStorageBackendZFSVolume withExpectedSize(java.util.Optional<? extends java.math.BigInteger> optional)Copy the current immutable object by setting an optional value for theexpectedSize
attribute. 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
this
object
-
equals
public boolean equals(java.lang.Object another)This instance is equal to all instances ofWXMStorageBackendZFSVolume
that have equal attribute values.- Overrides:
equals
in classjava.lang.Object
- Returns:
true
ifthis
is equal toanother
instance
-
hashCode
public int hashCode()Computes a hash code from attributes:comment
,expectedSize
.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- hashCode value
-
toString
public java.lang.String toString()Prints the immutable valueWXMStorageBackendZFSVolume
with attribute values.- Overrides:
toString
in classjava.lang.Object
- Returns:
- A string representation of the value
-
copyOf
public static WXMStorageBackendZFSVolume copyOf(WXMDeviceType.WXMStorageBackendZFSVolumeType instance)Creates an immutable copy of aWXMDeviceType.WXMStorageBackendZFSVolumeType
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 WXMStorageBackendZFSVolume instance
-
builder
Creates a builder forWXMStorageBackendZFSVolume
.WXMStorageBackendZFSVolume.builder() .setComment(String) // optional
comment
.setExpectedSize(java.math.BigInteger) // optionalexpectedSize
.build();- Returns:
- A new WXMStorageBackendZFSVolume builder
-