Package com.io7m.waxmill.machines
Class WXMZFSVolume
java.lang.Object
com.io7m.waxmill.machines.WXMZFSVolume
- All Implemented Interfaces:
WXMZFSVolumeType
public final class WXMZFSVolume extends java.lang.Object implements WXMZFSVolumeType
A ZFS volume.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classWXMZFSVolume.BuilderBuilds instances of typeWXMZFSVolume. -
Method Summary
Modifier and Type Method Description static WXMZFSVolume.Builderbuilder()Creates a builder forWXMZFSVolume.static WXMZFSVolumecopyOf(WXMZFSVolumeType instance)Creates an immutable copy of aWXMZFSVolumeTypevalue.java.nio.file.Pathdevice()The device node.booleanequals(java.lang.Object another)This instance is equal to all instances ofWXMZFSVolumethat have equal attribute values.inthashCode()Computes a hash code from attributes:name,device.java.lang.Stringname()The name of the volume.java.lang.StringtoString()Prints the immutable valueWXMZFSVolumewith attribute values.WXMZFSVolumewithDevice(java.nio.file.Path value)Copy the current immutable object by setting a value for thedeviceattribute.WXMZFSVolumewithName(java.lang.String value)Copy the current immutable object by setting a value for thenameattribute.
-
Method Details
-
name
public java.lang.String name()The name of the volume. This is the name that would be, for example, passed tozfs create -V name/of/volume.- Specified by:
namein interfaceWXMZFSVolumeType- Returns:
- The name of the volume
-
device
public java.nio.file.Path device()The device node. For example,/dev/zvol/path/to/volume.- Specified by:
devicein interfaceWXMZFSVolumeType- Returns:
- The device node
-
withName
Copy the current immutable object by setting a value for thenameattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for name- Returns:
- A modified copy of the
thisobject
-
withDevice
Copy the current immutable object by setting a value for thedeviceattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for device- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(java.lang.Object another)This instance is equal to all instances ofWXMZFSVolumethat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()Computes a hash code from attributes:name,device.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()Prints the immutable valueWXMZFSVolumewith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
copyOf
Creates an immutable copy of aWXMZFSVolumeTypevalue. 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 WXMZFSVolume instance
-
builder
Creates a builder forWXMZFSVolume.WXMZFSVolume.builder() .setName(String) // requiredname.setDevice(java.nio.file.Path) // requireddevice.build();- Returns:
- A new WXMZFSVolume builder
-