Package com.io7m.smfj.processing.api

## Class SMFMemoryMesh.Builder

- java.lang.Object
- - com.io7m.smfj.processing.api.SMFMemoryMesh.Builder

- Enclosing class:
    SMFMemoryMesh

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

  Builds instances of type `SMFMemoryMesh`. 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

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `SMFMemoryMesh.Builder` | `addAllMetadata​(java.lang.Iterable<? extends SMFMetadata> elements)` | Adds elements to `metadata` list.
    `SMFMemoryMesh.Builder` | `addAllTriangles​(java.lang.Iterable<? extends com.io7m.jtensors.core.unparameterized.vectors.Vector3L> elements)` | Adds elements to `triangles` list.
    `SMFMemoryMesh.Builder` | `addMetadata​(SMFMetadata element)` | Adds one element to `metadata` list.
    `SMFMemoryMesh.Builder` | `addMetadata​(SMFMetadata... elements)` | Adds elements to `metadata` list.
    `SMFMemoryMesh.Builder` | `addTriangles​(com.io7m.jtensors.core.unparameterized.vectors.Vector3L element)` | Adds one element to `triangles` list.
    `SMFMemoryMesh.Builder` | `addTriangles​(com.io7m.jtensors.core.unparameterized.vectors.Vector3L... elements)` | Adds elements to `triangles` list.
    `SMFMemoryMesh` | `build()` | Builds a new `SMFMemoryMesh`.
    `SMFMemoryMesh.Builder` | `from​(SMFMemoryMeshType instance)` | Fill a builder with attribute values from the provided `SMFMemoryMeshType` instance.
    `SMFMemoryMesh.Builder` | `putAllArrays​(java.util.Map<? extends SMFAttributeName,​? extends SMFAttributeArrayType> entries)` | Put all mappings from the specified map as entries to `arrays` map.
    `SMFMemoryMesh.Builder` | `putArrays​(SMFAttributeName key, SMFAttributeArrayType value)` | Put one entry to the `arrays` map.
    `SMFMemoryMesh.Builder` | `putArrays​(java.util.Map.Entry<? extends SMFAttributeName,​? extends SMFAttributeArrayType> entry)` | Put one entry to the `arrays` map.
    `SMFMemoryMesh.Builder` | `setArrays​(java.util.Map<? extends SMFAttributeName,​? extends SMFAttributeArrayType> entries)` | Sets or replaces all mappings from the specified map as entries for the `arrays` map.
    `SMFMemoryMesh.Builder` | `setHeader​(SMFHeader header)` | Initializes the value for the `header` attribute.
    `SMFMemoryMesh.Builder` | `setMetadata​(java.lang.Iterable<? extends SMFMetadata> elements)` | Sets or replaces all elements for `metadata` list.
    `SMFMemoryMesh.Builder` | `setTriangles​(java.lang.Iterable<? extends com.io7m.jtensors.core.unparameterized.vectors.Vector3L> elements)` | Sets or replaces all elements for `triangles` list.

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

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

- - ### Method Detail

    - #### from

          public final SMFMemoryMesh.Builder from​(SMFMemoryMeshType instance)

      Fill a builder with attribute values from the provided `SMFMemoryMeshType` 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

    - #### setHeader

          public final SMFMemoryMesh.Builder setHeader​(SMFHeader header)

      Initializes the value for the `header` attribute.
      Parameters:
        `header` - The value for header
      Returns:
        `this` builder for use in a chained invocation

    - #### putArrays

          public final SMFMemoryMesh.Builder putArrays​(SMFAttributeName key,
                                                       SMFAttributeArrayType value)

      Put one entry to the `arrays` map.
      Parameters:
        `key` - The key in the arrays map
        `value` - The associated value in the arrays map
      Returns:
        `this` builder for use in a chained invocation

    - #### putArrays

          public final SMFMemoryMesh.Builder putArrays​(java.util.Map.Entry<? extends SMFAttributeName,​? extends SMFAttributeArrayType> entry)

      Put one entry to the `arrays` map. Nulls are not permitted
      Parameters:
        `entry` - The key and value entry
      Returns:
        `this` builder for use in a chained invocation

    - #### setArrays

          public final SMFMemoryMesh.Builder setArrays​(java.util.Map<? extends SMFAttributeName,​? extends SMFAttributeArrayType> entries)

      Sets or replaces all mappings from the specified map as entries for the `arrays` map. Nulls are not permitted
      Parameters:
        `entries` - The entries that will be added to the arrays map
      Returns:
        `this` builder for use in a chained invocation

    - #### putAllArrays

          public final SMFMemoryMesh.Builder putAllArrays​(java.util.Map<? extends SMFAttributeName,​? extends SMFAttributeArrayType> entries)

      Put all mappings from the specified map as entries to `arrays` map. Nulls are not permitted
      Parameters:
        `entries` - The entries that will be added to the arrays map
      Returns:
        `this` builder for use in a chained invocation

    - #### addMetadata

          public final SMFMemoryMesh.Builder addMetadata​(SMFMetadata element)

      Adds one element to `metadata` list.
      Parameters:
        `element` - A metadata element
      Returns:
        `this` builder for use in a chained invocation

    - #### addMetadata

          public final SMFMemoryMesh.Builder addMetadata​(SMFMetadata... elements)

      Adds elements to `metadata` list.
      Parameters:
        `elements` - An array of metadata elements
      Returns:
        `this` builder for use in a chained invocation

    - #### setMetadata

          public final SMFMemoryMesh.Builder setMetadata​(java.lang.Iterable<? extends SMFMetadata> elements)

      Sets or replaces all elements for `metadata` list.
      Parameters:
        `elements` - An iterable of metadata elements
      Returns:
        `this` builder for use in a chained invocation

    - #### addAllMetadata

          public final SMFMemoryMesh.Builder addAllMetadata​(java.lang.Iterable<? extends SMFMetadata> elements)

      Adds elements to `metadata` list.
      Parameters:
        `elements` - An iterable of metadata elements
      Returns:
        `this` builder for use in a chained invocation

    - #### addTriangles

          public final SMFMemoryMesh.Builder addTriangles​(com.io7m.jtensors.core.unparameterized.vectors.Vector3L element)

      Adds one element to `triangles` list.
      Parameters:
        `element` - A triangles element
      Returns:
        `this` builder for use in a chained invocation

    - #### addTriangles

          public final SMFMemoryMesh.Builder addTriangles​(com.io7m.jtensors.core.unparameterized.vectors.Vector3L... elements)

      Adds elements to `triangles` list.
      Parameters:
        `elements` - An array of triangles elements
      Returns:
        `this` builder for use in a chained invocation

    - #### setTriangles

          public final SMFMemoryMesh.Builder setTriangles​(java.lang.Iterable<? extends com.io7m.jtensors.core.unparameterized.vectors.Vector3L> elements)

      Sets or replaces all elements for `triangles` list.
      Parameters:
        `elements` - An iterable of triangles elements
      Returns:
        `this` builder for use in a chained invocation

    - #### addAllTriangles

          public final SMFMemoryMesh.Builder addAllTriangles​(java.lang.Iterable<? extends com.io7m.jtensors.core.unparameterized.vectors.Vector3L> elements)

      Adds elements to `triangles` list.
      Parameters:
        `elements` - An iterable of triangles elements
      Returns:
        `this` builder for use in a chained invocation

    - #### build

          public SMFMemoryMesh build()

      Builds a new `SMFMemoryMesh`.
      Returns:
        An immutable instance of SMFMemoryMesh
      Throws:
        `java.lang.IllegalStateException` - if any required attributes are missing