Package com.io7m.waxmill.machines
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
-
Method Summary
Modifier and Type Method Description WXMMemorybuild()Builds a newWXMMemory.WXMMemory.Builderfrom(WXMMemoryType instance)Fill a builder with attribute values from the providedWXMMemoryTypeinstance.WXMMemory.BuildersetComment(java.lang.String comment)Initializes the value for thecommentattribute.WXMMemory.BuildersetGigabytes(java.math.BigInteger gigabytes)Initializes the value for thegigabytesattribute.WXMMemory.BuildersetMegabytes(java.math.BigInteger megabytes)Initializes the value for themegabytesattribute.
-
Method Details
-
from
Fill a builder with attribute values from the providedWXMMemoryTypeinstance. 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:
thisbuilder for use in a chained invocation
-
setMegabytes
Initializes the value for themegabytesattribute.If not set, this attribute will have a default value as returned by the initializer of
megabytes.- Parameters:
megabytes- The value for megabytes- Returns:
thisbuilder for use in a chained invocation
-
setGigabytes
Initializes the value for thegigabytesattribute.If not set, this attribute will have a default value as returned by the initializer of
gigabytes.- Parameters:
gigabytes- The value for gigabytes- Returns:
thisbuilder for use in a chained invocation
-
setComment
Initializes the value for thecommentattribute.If not set, this attribute will have a default value as returned by the initializer of
comment.- Parameters:
comment- The value for comment- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newWXMMemory.- Returns:
- An immutable instance of WXMMemory
- Throws:
java.lang.IllegalStateException- if any required attributes are missing
-