Package com.io7m.smfj.validation.api

## Class SMFSchemaAttribute.Builder

- java.lang.Object
- - com.io7m.smfj.validation.api.SMFSchemaAttribute.Builder

- Enclosing class:
    SMFSchemaAttribute

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

  Builds instances of type `SMFSchemaAttribute`. 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
    --- | --- | ---
    `SMFSchemaAttribute` | `build()` | Builds a new `SMFSchemaAttribute`.
    `SMFSchemaAttribute.Builder` | `from​(SMFSchemaAttributeType instance)` | Fill a builder with attribute values from the provided `SMFSchemaAttributeType` instance.
    `SMFSchemaAttribute.Builder` | `setName​(SMFAttributeName name)` | Initializes the value for the `name` attribute.
    `SMFSchemaAttribute.Builder` | `setRequiredComponentCount​(int requiredComponentCount)` | Initializes the optional value `requiredComponentCount` to requiredComponentCount.
    `SMFSchemaAttribute.Builder` | `setRequiredComponentCount​(java.util.OptionalInt requiredComponentCount)` | Initializes the optional value `requiredComponentCount` to requiredComponentCount.
    `SMFSchemaAttribute.Builder` | `setRequiredComponentSize​(int requiredComponentSize)` | Initializes the optional value `requiredComponentSize` to requiredComponentSize.
    `SMFSchemaAttribute.Builder` | `setRequiredComponentSize​(java.util.OptionalInt requiredComponentSize)` | Initializes the optional value `requiredComponentSize` to requiredComponentSize.
    `SMFSchemaAttribute.Builder` | `setRequiredComponentType​(SMFComponentType requiredComponentType)` | Initializes the optional value `requiredComponentType` to requiredComponentType.
    `SMFSchemaAttribute.Builder` | `setRequiredComponentType​(java.util.Optional<? extends SMFComponentType> requiredComponentType)` | Initializes the optional value `requiredComponentType` to requiredComponentType.

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

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

- - ### Method Detail

    - #### from

          public final SMFSchemaAttribute.Builder from​(SMFSchemaAttributeType instance)

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

    - #### setRequiredComponentType

          public final SMFSchemaAttribute.Builder setRequiredComponentType​(SMFComponentType requiredComponentType)

      Initializes the optional value `requiredComponentType` to requiredComponentType.
      Parameters:
        `requiredComponentType` - The value for requiredComponentType
      Returns:
        `this` builder for chained invocation

    - #### setRequiredComponentType

          public final SMFSchemaAttribute.Builder setRequiredComponentType​(java.util.Optional<? extends SMFComponentType> requiredComponentType)

      Initializes the optional value `requiredComponentType` to requiredComponentType.
      Parameters:
        `requiredComponentType` - The value for requiredComponentType
      Returns:
        `this` builder for use in a chained invocation

    - #### setRequiredComponentCount

          public final SMFSchemaAttribute.Builder setRequiredComponentCount​(int requiredComponentCount)

      Initializes the optional value `requiredComponentCount` to requiredComponentCount.
      Parameters:
        `requiredComponentCount` - The value for requiredComponentCount
      Returns:
        `this` builder for chained invocation

    - #### setRequiredComponentCount

          public final SMFSchemaAttribute.Builder setRequiredComponentCount​(java.util.OptionalInt requiredComponentCount)

      Initializes the optional value `requiredComponentCount` to requiredComponentCount.
      Parameters:
        `requiredComponentCount` - The value for requiredComponentCount
      Returns:
        `this` builder for use in a chained invocation

    - #### setRequiredComponentSize

          public final SMFSchemaAttribute.Builder setRequiredComponentSize​(int requiredComponentSize)

      Initializes the optional value `requiredComponentSize` to requiredComponentSize.
      Parameters:
        `requiredComponentSize` - The value for requiredComponentSize
      Returns:
        `this` builder for chained invocation

    - #### setRequiredComponentSize

          public final SMFSchemaAttribute.Builder setRequiredComponentSize​(java.util.OptionalInt requiredComponentSize)

      Initializes the optional value `requiredComponentSize` to requiredComponentSize.
      Parameters:
        `requiredComponentSize` - The value for requiredComponentSize
      Returns:
        `this` builder for use in a chained invocation

    - #### build

          public SMFSchemaAttribute build()

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