Package com.io7m.waxmill.machines
Class WXMCommandExecution.Builder
java.lang.Object
com.io7m.waxmill.machines.WXMCommandExecution.Builder
- Enclosing class:
- WXMCommandExecution
public static final class WXMCommandExecution.Builder
extends java.lang.Object
Builds instances of type
WXMCommandExecution.
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 WXMCommandExecution.BuilderaddAllArguments(java.lang.Iterable<java.lang.String> elements)Adds elements toargumentslist.WXMCommandExecution.BuilderaddArguments(java.lang.String element)Adds one element toargumentslist.WXMCommandExecution.BuilderaddArguments(java.lang.String... elements)Adds elements toargumentslist.WXMCommandExecutionbuild()Builds a newWXMCommandExecution.WXMCommandExecution.Builderfrom(WXMCommandExecutionType instance)Fill a builder with attribute values from the providedWXMCommandExecutionTypeinstance.WXMCommandExecution.BuildersetArguments(java.lang.Iterable<java.lang.String> elements)Sets or replaces all elements forargumentslist.WXMCommandExecution.BuildersetExecutable(java.nio.file.Path executable)Initializes the value for theexecutableattribute.
-
Method Details
-
from
Fill a builder with attribute values from the providedWXMCommandExecutionTypeinstance. 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:
thisbuilder for use in a chained invocation
-
setExecutable
Initializes the value for theexecutableattribute.- Parameters:
executable- The value for executable- Returns:
thisbuilder for use in a chained invocation
-
addArguments
Adds one element toargumentslist.- Parameters:
element- A arguments element- Returns:
thisbuilder for use in a chained invocation
-
addArguments
Adds elements toargumentslist.- Parameters:
elements- An array of arguments elements- Returns:
thisbuilder for use in a chained invocation
-
setArguments
public final WXMCommandExecution.Builder setArguments(java.lang.Iterable<java.lang.String> elements)Sets or replaces all elements forargumentslist.- Parameters:
elements- An iterable of arguments elements- Returns:
thisbuilder for use in a chained invocation
-
addAllArguments
public final WXMCommandExecution.Builder addAllArguments(java.lang.Iterable<java.lang.String> elements)Adds elements toargumentslist.- Parameters:
elements- An iterable of arguments elements- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newWXMCommandExecution.- Returns:
- An immutable instance of WXMCommandExecution
- Throws:
java.lang.IllegalStateException- if any required attributes are missing
-