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.Builder` | `addAllArguments​(java.lang.Iterable<java.lang.String> elements)` | Adds elements to `arguments` list.
  `WXMCommandExecution.Builder` | `addArguments​(java.lang.String element)` | Adds one element to `arguments` list.
  `WXMCommandExecution.Builder` | `addArguments​(java.lang.String... elements)` | Adds elements to `arguments` list.
  `WXMCommandExecution` | `build()` | Builds a new `WXMCommandExecution`.
  `WXMCommandExecution.Builder` | `from​(WXMCommandExecutionType instance)` | Fill a builder with attribute values from the provided `WXMCommandExecutionType` instance.
  `WXMCommandExecution.Builder` | `setArguments​(java.lang.Iterable<java.lang.String> elements)` | Sets or replaces all elements for `arguments` list.
  `WXMCommandExecution.Builder` | `setExecutable​(java.nio.file.Path executable)` | Initializes the value for the `executable` attribute.
  `WXMCommandExecution.Builder` | `setIgnoreFailure​(boolean ignoreFailure)` | Initializes the value for the `ignoreFailure` attribute.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Method Details

  - ### from

    public final WXMCommandExecution.Builder from​(WXMCommandExecutionType instance)
    Fill a builder with attribute values from the provided `WXMCommandExecutionType` 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

  - ### setExecutable

    public final WXMCommandExecution.Builder setExecutable​(java.nio.file.Path executable)
    Initializes the value for the `executable` attribute.
    Parameters:
      `executable` - The value for executable
    Returns:
      `this` builder for use in a chained invocation

  - ### addArguments

    public final WXMCommandExecution.Builder addArguments​(java.lang.String element)
    Adds one element to `arguments` list.
    Parameters:
      `element` - A arguments element
    Returns:
      `this` builder for use in a chained invocation

  - ### addArguments

    public final WXMCommandExecution.Builder addArguments​(java.lang.String... elements)
    Adds elements to `arguments` list.
    Parameters:
      `elements` - An array of arguments elements
    Returns:
      `this` builder for use in a chained invocation

  - ### setArguments

    public final WXMCommandExecution.Builder setArguments​(java.lang.Iterable<java.lang.String> elements)
    Sets or replaces all elements for `arguments` list.
    Parameters:
      `elements` - An iterable of arguments elements
    Returns:
      `this` builder for use in a chained invocation

  - ### addAllArguments

    public final WXMCommandExecution.Builder addAllArguments​(java.lang.Iterable<java.lang.String> elements)
    Adds elements to `arguments` list.
    Parameters:
      `elements` - An iterable of arguments elements
    Returns:
      `this` builder for use in a chained invocation

  - ### setIgnoreFailure

    public final WXMCommandExecution.Builder setIgnoreFailure​(boolean ignoreFailure)
    Initializes the value for the `ignoreFailure` attribute.

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

    Parameters:
      `ignoreFailure` - The value for ignoreFailure
    Returns:
      `this` builder for use in a chained invocation

  - ### build

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