Package com.io7m.waxmill.machines

# Class WXMTap.Builder

java.lang.Object
com.io7m.waxmill.machines.WXMTap.Builder

Enclosing class:
  WXMTap

    public static final class WXMTap.Builder
    extends java.lang.Object

Builds instances of type `WXMTap`. 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
  --- | --- | ---
  `WXMTap.Builder` | `addAllGroups​(java.lang.Iterable<? extends WXMInterfaceGroupName> elements)` | Adds elements to `groups` list.
  `WXMTap.Builder` | `addGroups​(WXMInterfaceGroupName element)` | Adds one element to `groups` list.
  `WXMTap.Builder` | `addGroups​(WXMInterfaceGroupName... elements)` | Adds elements to `groups` list.
  `WXMTap` | `build()` | Builds a new `WXMTap`.
  `WXMTap.Builder` | `from​(WXMNetworkDeviceBackendType instance)` | Fill a builder with attribute values from the provided `com.io7m.waxmill.machines.WXMNetworkDeviceBackendType` instance.
  `WXMTap.Builder` | `from​(WXMTapType instance)` | Fill a builder with attribute values from the provided `com.io7m.waxmill.machines.WXMTapType` instance.
  `WXMTap.Builder` | `setAddress​(WXMMACAddress address)` | Initializes the value for the `address` attribute.
  `WXMTap.Builder` | `setComment​(java.lang.String comment)` | Initializes the value for the `comment` attribute.
  `WXMTap.Builder` | `setGroups​(java.lang.Iterable<? extends WXMInterfaceGroupName> elements)` | Sets or replaces all elements for `groups` list.
  `WXMTap.Builder` | `setName​(WXMTAPDeviceName name)` | Initializes the value for the `name` attribute.

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

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

- ## Method Details

  - ### from

    public final WXMTap.Builder from​(WXMTapType instance)
    Fill a builder with attribute values from the provided `com.io7m.waxmill.machines.WXMTapType` instance.
    Parameters:
      `instance` - The instance from which to copy values
    Returns:
      `this` builder for use in a chained invocation

  - ### from

    public final WXMTap.Builder from​(WXMNetworkDeviceBackendType instance)
    Fill a builder with attribute values from the provided `com.io7m.waxmill.machines.WXMNetworkDeviceBackendType` instance.
    Parameters:
      `instance` - The instance from which to copy values
    Returns:
      `this` builder for use in a chained invocation

  - ### setName

    public final WXMTap.Builder setName​(WXMTAPDeviceName name)
    Initializes the value for the `name` attribute.
    Parameters:
      `name` - The value for name
    Returns:
      `this` builder for use in a chained invocation

  - ### setAddress

    public final WXMTap.Builder setAddress​(WXMMACAddress address)
    Initializes the value for the `address` attribute.
    Parameters:
      `address` - The value for address
    Returns:
      `this` builder for use in a chained invocation

  - ### addGroups

    public final WXMTap.Builder addGroups​(WXMInterfaceGroupName element)
    Adds one element to `groups` list.
    Parameters:
      `element` - A groups element
    Returns:
      `this` builder for use in a chained invocation

  - ### addGroups

    public final WXMTap.Builder addGroups​(WXMInterfaceGroupName... elements)
    Adds elements to `groups` list.
    Parameters:
      `elements` - An array of groups elements
    Returns:
      `this` builder for use in a chained invocation

  - ### setGroups

    public final WXMTap.Builder setGroups​(java.lang.Iterable<? extends WXMInterfaceGroupName> elements)
    Sets or replaces all elements for `groups` list.
    Parameters:
      `elements` - An iterable of groups elements
    Returns:
      `this` builder for use in a chained invocation

  - ### addAllGroups

    public final WXMTap.Builder addAllGroups​(java.lang.Iterable<? extends WXMInterfaceGroupName> elements)
    Adds elements to `groups` list.
    Parameters:
      `elements` - An iterable of groups elements
    Returns:
      `this` builder for use in a chained invocation

  - ### setComment

    public final WXMTap.Builder setComment​(java.lang.String comment)
    Initializes the value for the `comment` 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

  - ### build

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