Package com.io7m.waxmill.machines

# Class WXMCPUTopology.Builder

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

Enclosing class:
  WXMCPUTopology

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

Builds instances of type `WXMCPUTopology`. 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
  --- | --- | ---
  `WXMCPUTopology.Builder` | `addAllPinnedCPUs​(java.lang.Iterable<? extends WXMPinCPU> elements)` | Adds elements to `pinnedCPUs` list.
  `WXMCPUTopology.Builder` | `addPinnedCPUs​(WXMPinCPU element)` | Adds one element to `pinnedCPUs` list.
  `WXMCPUTopology.Builder` | `addPinnedCPUs​(WXMPinCPU... elements)` | Adds elements to `pinnedCPUs` list.
  `WXMCPUTopology` | `build()` | Builds a new `WXMCPUTopology`.
  `WXMCPUTopology.Builder` | `from​(WXMCPUTopologyType instance)` | Fill a builder with attribute values from the provided `WXMCPUTopologyType` instance.
  `WXMCPUTopology.Builder` | `setComment​(java.lang.String comment)` | Initializes the value for the `comment` attribute.
  `WXMCPUTopology.Builder` | `setCores​(int cores)` | Initializes the value for the `cores` attribute.
  `WXMCPUTopology.Builder` | `setCpus​(int cpus)` | Initializes the value for the `cpus` attribute.
  `WXMCPUTopology.Builder` | `setPinnedCPUs​(java.lang.Iterable<? extends WXMPinCPU> elements)` | Sets or replaces all elements for `pinnedCPUs` list.
  `WXMCPUTopology.Builder` | `setSockets​(int sockets)` | Initializes the value for the `sockets` attribute.
  `WXMCPUTopology.Builder` | `setThreads​(int threads)` | Initializes the value for the `threads` attribute.

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

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

- ## Method Details

  - ### from

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

  - ### setSockets

    public final WXMCPUTopology.Builder setSockets​(int sockets)
    Initializes the value for the `sockets` attribute.

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

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

  - ### setThreads

    public final WXMCPUTopology.Builder setThreads​(int threads)
    Initializes the value for the `threads` attribute.

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

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

  - ### setCores

    public final WXMCPUTopology.Builder setCores​(int cores)
    Initializes the value for the `cores` attribute.

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

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

  - ### setCpus

    public final WXMCPUTopology.Builder setCpus​(int cpus)
    Initializes the value for the `cpus` attribute.

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

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

  - ### setComment

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

  - ### addPinnedCPUs

    public final WXMCPUTopology.Builder addPinnedCPUs​(WXMPinCPU element)
    Adds one element to `pinnedCPUs` list.
    Parameters:
      `element` - A pinnedCPUs element
    Returns:
      `this` builder for use in a chained invocation

  - ### addPinnedCPUs

    public final WXMCPUTopology.Builder addPinnedCPUs​(WXMPinCPU... elements)
    Adds elements to `pinnedCPUs` list.
    Parameters:
      `elements` - An array of pinnedCPUs elements
    Returns:
      `this` builder for use in a chained invocation

  - ### setPinnedCPUs

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

  - ### addAllPinnedCPUs

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

  - ### build

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