com.io7m.smfj.core

## Class SMFAttribute.Builder

- java.lang.Object
- - com.io7m.smfj.core.SMFAttribute.Builder

- Enclosing class:
    SMFAttribute

      public static final class SMFAttribute.Builder
      extends Object

  Builds instances of type `SMFAttribute`. 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 and Description
    --- | ---
    `SMFAttribute` | `build()` Builds a new `SMFAttribute`.
    `SMFAttribute.Builder` | `from(SMFAttributeType instance)` Fill a builder with attribute values from the provided `SMFAttributeType` instance.
    `SMFAttribute.Builder` | `setComponentCount(int componentCount)` Initializes the value for the `componentCount` attribute.
    `SMFAttribute.Builder` | `setComponentSizeBits(int componentSizeBits)` Initializes the value for the `componentSizeBits` attribute.
    `SMFAttribute.Builder` | `setComponentType(SMFComponentType componentType)` Initializes the value for the `componentType` attribute.
    `SMFAttribute.Builder` | `setName(SMFAttributeName 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 Detail

    - #### from

          public final SMFAttribute.Builder from(SMFAttributeType instance)

      Fill a builder with attribute values from the provided `SMFAttributeType` instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.
      Parameters:
        `instance` - The instance from which to copy values
      Returns:
        `this` builder for use in a chained invocation

    - #### setName

          public final SMFAttribute.Builder setName(SMFAttributeName name)

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

    - #### setComponentType

          public final SMFAttribute.Builder setComponentType(SMFComponentType componentType)

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

    - #### setComponentCount

          public final SMFAttribute.Builder setComponentCount(int componentCount)

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

    - #### setComponentSizeBits

          public final SMFAttribute.Builder setComponentSizeBits(int componentSizeBits)

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

    - #### build

          public SMFAttribute build()

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

Copyright © 2017 <code@io7m.com> http://io7m.com