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 class` | `WXMZFSVolume.Builder` | Builds instances of type `WXMZFSVolume`.

- ## Method Summary

  Modifier and Type | Method | Description
  --- | --- | ---
  `static WXMZFSVolume.Builder` | `builder()` | Creates a builder for `WXMZFSVolume`.
  `static WXMZFSVolume` | `copyOf​(WXMZFSVolumeType instance)` | Creates an immutable copy of a `WXMZFSVolumeType` value.
  `java.nio.file.Path` | `device()` | The device node.
  `boolean` | `equals​(java.lang.Object another)` | This instance is equal to all instances of `WXMZFSVolume` that have equal attribute values.
  `int` | `hashCode()` | Computes a hash code from attributes: `name`, `device`.
  `java.lang.String` | `name()` | The name of the volume.
  `java.lang.String` | `toString()` | Prints the immutable value `WXMZFSVolume` with attribute values.
  `WXMZFSVolume` | `withDevice​(java.nio.file.Path value)` | Copy the current immutable object by setting a value for the `device` attribute.
  `WXMZFSVolume` | `withName​(java.lang.String value)` | Copy the current immutable object by setting a value for the `name` attribute.

  ### Methods inherited from class java.lang.Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

  ### Methods inherited from interface com.io7m.waxmill.machines.WXMZFSVolumeType

  `checkPreconditions`

- ## Method Details

  - ### name

    public java.lang.String name()
    The name of the volume. This is the name that would be, for example, passed to `zfs create -V name/of/volume`.
    Specified by:
      `name` in interface `WXMZFSVolumeType`
    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:
      `device` in interface `WXMZFSVolumeType`
    Returns:
      The device node

  - ### withName

    public final WXMZFSVolume withName​(java.lang.String value)
    Copy the current immutable object by setting a value for the `name` attribute. An equals check used to prevent copying of the same value by returning `this`.
    Parameters:
      `value` - A new value for name
    Returns:
      A modified copy of the `this` object

  - ### withDevice

    public final WXMZFSVolume withDevice​(java.nio.file.Path value)
    Copy the current immutable object by setting a value for the `device` attribute. A shallow reference equality check is used to prevent copying of the same value by returning `this`.
    Parameters:
      `value` - A new value for device
    Returns:
      A modified copy of the `this` object

  - ### equals

    public boolean equals​(java.lang.Object another)
    This instance is equal to all instances of `WXMZFSVolume` that have equal attribute values.
    Overrides:
      `equals` in class `java.lang.Object`
    Returns:
      `true` if `this` is equal to `another` instance

  - ### hashCode

    public int hashCode()
    Computes a hash code from attributes: `name`, `device`.
    Overrides:
      `hashCode` in class `java.lang.Object`
    Returns:
      hashCode value

  - ### toString

    public java.lang.String toString()
    Prints the immutable value `WXMZFSVolume` with attribute values.
    Overrides:
      `toString` in class `java.lang.Object`
    Returns:
      A string representation of the value

  - ### copyOf

    public static WXMZFSVolume copyOf​(WXMZFSVolumeType instance)
    Creates an immutable copy of a `WXMZFSVolumeType` 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 WXMZFSVolume instance

  - ### builder

    public static WXMZFSVolume.Builder builder()
    Creates a builder for `WXMZFSVolume`.

         WXMZFSVolume.builder()
            .setName(String) // required name
            .setDevice(java.nio.file.Path) // required device
            .build();

    Returns:
      A new WXMZFSVolume builder