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().

  • Method Details

    • comment

      public java.lang.String comment()
      Specified by:
      comment in interface WXMDeviceType.WXMStorageBackendType
      Specified by:
      comment in interface WXMDeviceType.WXMStorageBackendZFSVolumeType
      Returns:
      The value of the comment attribute
    • expectedSize

      public java.util.Optional<java.math.BigInteger> expectedSize()
      Specified by:
      expectedSize in interface WXMDeviceType.WXMStorageBackendZFSVolumeType
      Returns:
      The expected size, in bytes, of the ZFS volume
    • withComment

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

      public final WXMStorageBackendZFSVolume withExpectedSize​(java.math.BigInteger value)
      Copy the current immutable object by setting a present value for the optional expectedSize 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 the expectedSize attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      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 of WXMStorageBackendZFSVolume 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: comment, expectedSize.
      Overrides:
      hashCode in class java.lang.Object
      Returns:
      hashCode value
    • toString

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

      Creates an immutable copy of a WXMDeviceType.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

      public static WXMStorageBackendZFSVolume.Builder builder()
      Creates a builder for WXMStorageBackendZFSVolume.
       WXMStorageBackendZFSVolume.builder()
          .setComment(String) // optional comment
          .setExpectedSize(java.math.BigInteger) // optional expectedSize
          .build();
       
      Returns:
      A new WXMStorageBackendZFSVolume builder