Package com.io7m.waxmill.machines

# Class WXMVirtualMachine.Builder

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

Enclosing class:
  WXMVirtualMachine

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

Builds instances of type `WXMVirtualMachine`. 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
  --- | --- | ---
  `WXMVirtualMachine.Builder` | `addAllBootConfigurations​(java.lang.Iterable<? extends WXMBootConfigurationType> elements)` | Adds elements to `bootConfigurations` list.
  `WXMVirtualMachine.Builder` | `addAllDevices​(java.lang.Iterable<? extends WXMDeviceType> elements)` | Adds elements to `devices` list.
  `WXMVirtualMachine.Builder` | `addBootConfigurations​(WXMBootConfigurationType element)` | Adds one element to `bootConfigurations` list.
  `WXMVirtualMachine.Builder` | `addBootConfigurations​(WXMBootConfigurationType... elements)` | Adds elements to `bootConfigurations` list.
  `WXMVirtualMachine.Builder` | `addDevices​(WXMDeviceType element)` | Adds one element to `devices` list.
  `WXMVirtualMachine.Builder` | `addDevices​(WXMDeviceType... elements)` | Adds elements to `devices` list.
  `WXMVirtualMachine` | `build()` | Builds a new `WXMVirtualMachine`.
  `WXMVirtualMachine.Builder` | `from​(WXMVirtualMachineType instance)` | Fill a builder with attribute values from the provided `WXMVirtualMachineType` instance.
  `WXMVirtualMachine.Builder` | `setBootConfigurations​(java.lang.Iterable<? extends WXMBootConfigurationType> elements)` | Sets or replaces all elements for `bootConfigurations` list.
  `WXMVirtualMachine.Builder` | `setComment​(java.lang.String comment)` | Initializes the value for the `comment` attribute.
  `WXMVirtualMachine.Builder` | `setConfigurationFile​(java.net.URI configurationFile)` | Initializes the optional value `configurationFile` to configurationFile.
  `WXMVirtualMachine.Builder` | `setConfigurationFile​(java.util.Optional<? extends java.net.URI> configurationFile)` | Initializes the optional value `configurationFile` to configurationFile.
  `WXMVirtualMachine.Builder` | `setCpuTopology​(WXMCPUTopology cpuTopology)` | Initializes the value for the `cpuTopology` attribute.
  `WXMVirtualMachine.Builder` | `setDevices​(java.lang.Iterable<? extends WXMDeviceType> elements)` | Sets or replaces all elements for `devices` list.
  `WXMVirtualMachine.Builder` | `setFlags​(WXMFlags flags)` | Initializes the value for the `flags` attribute.
  `WXMVirtualMachine.Builder` | `setId​(java.util.UUID id)` | Initializes the value for the `id` attribute.
  `WXMVirtualMachine.Builder` | `setMemory​(WXMMemory memory)` | Initializes the value for the `memory` attribute.
  `WXMVirtualMachine.Builder` | `setName​(WXMMachineName 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 WXMVirtualMachine.Builder from​(WXMVirtualMachineType instance)
    Fill a builder with attribute values from the provided `WXMVirtualMachineType` 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

  - ### setId

    public final WXMVirtualMachine.Builder setId​(java.util.UUID id)
    Initializes the value for the `id` attribute.
    Parameters:
      `id` - The value for id
    Returns:
      `this` builder for use in a chained invocation

  - ### setName

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

  - ### setComment

    public final WXMVirtualMachine.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

  - ### setCpuTopology

    public final WXMVirtualMachine.Builder setCpuTopology​(WXMCPUTopology cpuTopology)
    Initializes the value for the `cpuTopology` attribute.

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

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

  - ### setMemory

    public final WXMVirtualMachine.Builder setMemory​(WXMMemory memory)
    Initializes the value for the `memory` attribute.

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

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

  - ### addDevices

    public final WXMVirtualMachine.Builder addDevices​(WXMDeviceType element)
    Adds one element to `devices` list.
    Parameters:
      `element` - A devices element
    Returns:
      `this` builder for use in a chained invocation

  - ### addDevices

    public final WXMVirtualMachine.Builder addDevices​(WXMDeviceType... elements)
    Adds elements to `devices` list.
    Parameters:
      `elements` - An array of devices elements
    Returns:
      `this` builder for use in a chained invocation

  - ### setDevices

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

  - ### addAllDevices

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

  - ### setFlags

    public final WXMVirtualMachine.Builder setFlags​(WXMFlags flags)
    Initializes the value for the `flags` attribute.

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

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

  - ### addBootConfigurations

    public final WXMVirtualMachine.Builder addBootConfigurations​(WXMBootConfigurationType element)
    Adds one element to `bootConfigurations` list.
    Parameters:
      `element` - A bootConfigurations element
    Returns:
      `this` builder for use in a chained invocation

  - ### addBootConfigurations

    public final WXMVirtualMachine.Builder addBootConfigurations​(WXMBootConfigurationType... elements)
    Adds elements to `bootConfigurations` list.
    Parameters:
      `elements` - An array of bootConfigurations elements
    Returns:
      `this` builder for use in a chained invocation

  - ### setBootConfigurations

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

  - ### addAllBootConfigurations

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

  - ### setConfigurationFile

    public final WXMVirtualMachine.Builder setConfigurationFile​(java.net.URI configurationFile)
    Initializes the optional value `configurationFile` to configurationFile.
    Parameters:
      `configurationFile` - The value for configurationFile
    Returns:
      `this` builder for chained invocation

  - ### setConfigurationFile

    public final WXMVirtualMachine.Builder setConfigurationFile​(java.util.Optional<? extends java.net.URI> configurationFile)
    Initializes the optional value `configurationFile` to configurationFile.
    Parameters:
      `configurationFile` - The value for configurationFile
    Returns:
      `this` builder for use in a chained invocation

  - ### build

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