Package com.io7m.waxmill.machines
Class WXMDeviceLPC.Builder
java.lang.Object
com.io7m.waxmill.machines.WXMDeviceLPC.Builder
- Enclosing class:
- WXMDeviceLPC
public static final class WXMDeviceLPC.Builder
extends java.lang.Object
Builds instances of type
WXMDeviceLPC.
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 WXMDeviceLPC.BuilderaddAllBackends(java.lang.Iterable<? extends WXMDeviceType.WXMTTYBackendType> elements)Adds elements tobackendslist.WXMDeviceLPC.BuilderaddBackends(WXMDeviceType.WXMTTYBackendType element)Adds one element tobackendslist.WXMDeviceLPC.BuilderaddBackends(WXMDeviceType.WXMTTYBackendType... elements)Adds elements tobackendslist.WXMDeviceLPCbuild()Builds a newWXMDeviceLPC.WXMDeviceLPC.Builderfrom(WXMDeviceType instance)Fill a builder with attribute values from the providedcom.io7m.waxmill.machines.WXMDeviceTypeinstance.WXMDeviceLPC.Builderfrom(WXMDeviceType.WXMDeviceLPCType instance)Fill a builder with attribute values from the providedcom.io7m.waxmill.machines.WXMDeviceType.WXMDeviceLPCTypeinstance.WXMDeviceLPC.BuildersetBackends(java.lang.Iterable<? extends WXMDeviceType.WXMTTYBackendType> elements)Sets or replaces all elements forbackendslist.WXMDeviceLPC.BuildersetComment(java.lang.String comment)Initializes the value for thecommentattribute.WXMDeviceLPC.BuildersetDeviceSlot(WXMDeviceSlot deviceSlot)Initializes the value for thedeviceSlotattribute.
-
Method Details
-
from
Fill a builder with attribute values from the providedcom.io7m.waxmill.machines.WXMDeviceType.WXMDeviceLPCTypeinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
from
Fill a builder with attribute values from the providedcom.io7m.waxmill.machines.WXMDeviceTypeinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
setDeviceSlot
Initializes the value for thedeviceSlotattribute.- Parameters:
deviceSlot- The value for deviceSlot- 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
-
addBackends
Adds one element tobackendslist.- Parameters:
element- A backends element- Returns:
thisbuilder for use in a chained invocation
-
addBackends
Adds elements tobackendslist.- Parameters:
elements- An array of backends elements- Returns:
thisbuilder for use in a chained invocation
-
setBackends
public final WXMDeviceLPC.Builder setBackends(java.lang.Iterable<? extends WXMDeviceType.WXMTTYBackendType> elements)Sets or replaces all elements forbackendslist.- Parameters:
elements- An iterable of backends elements- Returns:
thisbuilder for use in a chained invocation
-
addAllBackends
public final WXMDeviceLPC.Builder addAllBackends(java.lang.Iterable<? extends WXMDeviceType.WXMTTYBackendType> elements)Adds elements tobackendslist.- Parameters:
elements- An iterable of backends elements- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newWXMDeviceLPC.- Returns:
- An immutable instance of WXMDeviceLPC
- Throws:
java.lang.IllegalStateException- if any required attributes are missing
-