Class WXMMemory.Builder

java.lang.Object
com.io7m.waxmill.machines.WXMMemory.Builder
Enclosing class:
WXMMemory

public static final class WXMMemory.Builder
extends java.lang.Object
Builds instances of type WXMMemory. Initialize attributes and then invoke the build() method to create an immutable instance.

Builder is not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.

  • Method Details

    • from

      public final WXMMemory.Builder from​(WXMMemoryType instance)
      Fill a builder with attribute values from the provided WXMMemoryType instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • setMegabytes

      public final WXMMemory.Builder setMegabytes​(java.math.BigInteger megabytes)
      Initializes the value for the megabytes attribute.

      If not set, this attribute will have a default value as returned by the initializer of megabytes.

      Parameters:
      megabytes - The value for megabytes
      Returns:
      this builder for use in a chained invocation
    • setGigabytes

      public final WXMMemory.Builder setGigabytes​(java.math.BigInteger gigabytes)
      Initializes the value for the gigabytes attribute.

      If not set, this attribute will have a default value as returned by the initializer of gigabytes.

      Parameters:
      gigabytes - The value for gigabytes
      Returns:
      this builder for use in a chained invocation
    • setComment

      public final WXMMemory.Builder setComment​(java.lang.String comment)
      Initializes the value for the comment attribute.

      If not set, this attribute will have a default value as returned by the initializer of comment.

      Parameters:
      comment - The value for comment
      Returns:
      this builder for use in a chained invocation
    • build

      public WXMMemory build()
      Builds a new WXMMemory.
      Returns:
      An immutable instance of WXMMemory
      Throws:
      java.lang.IllegalStateException - if any required attributes are missing