Package com.io7m.waxmill.machines
Class WXMCPUTopology.Builder
java.lang.Object
com.io7m.waxmill.machines.WXMCPUTopology.Builder
- Enclosing class:
- WXMCPUTopology
public static final class WXMCPUTopology.Builder
extends java.lang.Object
Builds instances of type
WXMCPUTopology
.
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 Summary
Modifier and Type Method Description WXMCPUTopology.Builder
addAllPinnedCPUs(java.lang.Iterable<? extends WXMPinCPU> elements)
Adds elements topinnedCPUs
list.WXMCPUTopology.Builder
addPinnedCPUs(WXMPinCPU element)
Adds one element topinnedCPUs
list.WXMCPUTopology.Builder
addPinnedCPUs(WXMPinCPU... elements)
Adds elements topinnedCPUs
list.WXMCPUTopology
build()
Builds a newWXMCPUTopology
.WXMCPUTopology.Builder
from(WXMCPUTopologyType instance)
Fill a builder with attribute values from the providedWXMCPUTopologyType
instance.WXMCPUTopology.Builder
setComment(java.lang.String comment)
Initializes the value for thecomment
attribute.WXMCPUTopology.Builder
setCores(int cores)
Initializes the value for thecores
attribute.WXMCPUTopology.Builder
setCpus(int cpus)
Initializes the value for thecpus
attribute.WXMCPUTopology.Builder
setPinnedCPUs(java.lang.Iterable<? extends WXMPinCPU> elements)
Sets or replaces all elements forpinnedCPUs
list.WXMCPUTopology.Builder
setSockets(int sockets)
Initializes the value for thesockets
attribute.WXMCPUTopology.Builder
setThreads(int threads)
Initializes the value for thethreads
attribute.
-
Method Details
-
from
Fill a builder with attribute values from the providedWXMCPUTopologyType
instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values. Collection elements and entries will be added, not replaced.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
setSockets
Initializes the value for thesockets
attribute.If not set, this attribute will have a default value as returned by the initializer of
sockets
.- Parameters:
sockets
- The value for sockets- Returns:
this
builder for use in a chained invocation
-
setThreads
Initializes the value for thethreads
attribute.If not set, this attribute will have a default value as returned by the initializer of
threads
.- Parameters:
threads
- The value for threads- Returns:
this
builder for use in a chained invocation
-
setCores
Initializes the value for thecores
attribute.If not set, this attribute will have a default value as returned by the initializer of
cores
.- Parameters:
cores
- The value for cores- Returns:
this
builder for use in a chained invocation
-
setCpus
Initializes the value for thecpus
attribute.If not set, this attribute will have a default value as returned by the initializer of
cpus
.- Parameters:
cpus
- The value for cpus- Returns:
this
builder for use in a chained invocation
-
setComment
Initializes the value for thecomment
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
-
addPinnedCPUs
Adds one element topinnedCPUs
list.- Parameters:
element
- A pinnedCPUs element- Returns:
this
builder for use in a chained invocation
-
addPinnedCPUs
Adds elements topinnedCPUs
list.- Parameters:
elements
- An array of pinnedCPUs elements- Returns:
this
builder for use in a chained invocation
-
setPinnedCPUs
public final WXMCPUTopology.Builder setPinnedCPUs(java.lang.Iterable<? extends WXMPinCPU> elements)Sets or replaces all elements forpinnedCPUs
list.- Parameters:
elements
- An iterable of pinnedCPUs elements- Returns:
this
builder for use in a chained invocation
-
addAllPinnedCPUs
public final WXMCPUTopology.Builder addAllPinnedCPUs(java.lang.Iterable<? extends WXMPinCPU> elements)Adds elements topinnedCPUs
list.- Parameters:
elements
- An iterable of pinnedCPUs elements- Returns:
this
builder for use in a chained invocation
-
build
Builds a newWXMCPUTopology
.- Returns:
- An immutable instance of WXMCPUTopology
- Throws:
java.lang.IllegalStateException
- if any required attributes are missing
-