com.io7m.smfj.validation.api

## Class SMFSchema.Builder

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

- Enclosing class:
    SMFSchema

      public static final class SMFSchema.Builder
      extends Object

  Builds instances of type `SMFSchema`. 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
    --- | ---
    `SMFSchema` | `build()` Builds a new `SMFSchema`.
    `SMFSchema.Builder` | `from(SMFSchemaType instance)` Fill a builder with attribute values from the provided `SMFSchemaType` instance.
    `SMFSchema.Builder` | `putEntryOptionalAttributes(javaslang.Tuple2<SMFAttributeName,SMFSchemaAttribute> entry)`
    `SMFSchema.Builder` | `putEntryRequiredAttributes(javaslang.Tuple2<SMFAttributeName,SMFSchemaAttribute> entry)`
    `SMFSchema.Builder` | `putOptionalAttributes(SMFAttributeName key, SMFSchemaAttribute value)`
    `SMFSchema.Builder` | `putRequiredAttributes(SMFAttributeName key, SMFSchemaAttribute value)`
    `SMFSchema.Builder` | `setAllowExtraAttributes(boolean allowExtraAttributes)` Initializes the value for the `allowExtraAttributes` attribute.
    `SMFSchema.Builder` | `setEntriesOptionalAttributes(Iterable<javaslang.Tuple2<SMFAttributeName,SMFSchemaAttribute>> entries)`
    `SMFSchema.Builder` | `setEntriesRequiredAttributes(Iterable<javaslang.Tuple2<SMFAttributeName,SMFSchemaAttribute>> entries)`
    `SMFSchema.Builder` | `setJavaMapOptionalAttributes(Map<SMFAttributeName,SMFSchemaAttribute> in_map)`
    `SMFSchema.Builder` | `setJavaMapRequiredAttributes(Map<SMFAttributeName,SMFSchemaAttribute> in_map)`
    `SMFSchema.Builder` | `setMapOptionalAttributes(javaslang.collection.Map<SMFAttributeName,SMFSchemaAttribute> in_map)`
    `SMFSchema.Builder` | `setMapRequiredAttributes(javaslang.collection.Map<SMFAttributeName,SMFSchemaAttribute> in_map)`
    `SMFSchema.Builder` | `setOptionalAttributes(javaslang.collection.SortedMap<SMFAttributeName,SMFSchemaAttribute> elements)`
    `SMFSchema.Builder` | `setRequiredAttributes(javaslang.collection.SortedMap<SMFAttributeName,SMFSchemaAttribute> elements)`
    `SMFSchema.Builder` | `setRequiredCoordinateSystem(Optional<? extends SMFCoordinateSystem> requiredCoordinateSystem)` Initializes the optional value `requiredCoordinateSystem` to requiredCoordinateSystem.
    `SMFSchema.Builder` | `setRequiredCoordinateSystem(SMFCoordinateSystem requiredCoordinateSystem)` Initializes the optional value `requiredCoordinateSystem` to requiredCoordinateSystem.
    `SMFSchema.Builder` | `setSchemaIdentifier(SMFSchemaIdentifier schemaIdentifier)` Initializes the value for the `schemaIdentifier` attribute.

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

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

- - ### Method Detail

    - #### from

          public final SMFSchema.Builder from(SMFSchemaType instance)

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

    - #### setSchemaIdentifier

          public final SMFSchema.Builder setSchemaIdentifier(SMFSchemaIdentifier schemaIdentifier)

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

    - #### putRequiredAttributes

          public SMFSchema.Builder putRequiredAttributes(SMFAttributeName key,
                                                         SMFSchemaAttribute value)

    - #### putEntryRequiredAttributes

          public SMFSchema.Builder putEntryRequiredAttributes(javaslang.Tuple2<SMFAttributeName,SMFSchemaAttribute> entry)

    - #### setRequiredAttributes

          public SMFSchema.Builder setRequiredAttributes(javaslang.collection.SortedMap<SMFAttributeName,SMFSchemaAttribute> elements)

    - #### setJavaMapRequiredAttributes

          public SMFSchema.Builder setJavaMapRequiredAttributes(Map<SMFAttributeName,SMFSchemaAttribute> in_map)

    - #### setMapRequiredAttributes

          public SMFSchema.Builder setMapRequiredAttributes(javaslang.collection.Map<SMFAttributeName,SMFSchemaAttribute> in_map)

    - #### setEntriesRequiredAttributes

          public SMFSchema.Builder setEntriesRequiredAttributes(Iterable<javaslang.Tuple2<SMFAttributeName,SMFSchemaAttribute>> entries)

    - #### putOptionalAttributes

          public SMFSchema.Builder putOptionalAttributes(SMFAttributeName key,
                                                         SMFSchemaAttribute value)

    - #### putEntryOptionalAttributes

          public SMFSchema.Builder putEntryOptionalAttributes(javaslang.Tuple2<SMFAttributeName,SMFSchemaAttribute> entry)

    - #### setOptionalAttributes

          public SMFSchema.Builder setOptionalAttributes(javaslang.collection.SortedMap<SMFAttributeName,SMFSchemaAttribute> elements)

    - #### setJavaMapOptionalAttributes

          public SMFSchema.Builder setJavaMapOptionalAttributes(Map<SMFAttributeName,SMFSchemaAttribute> in_map)

    - #### setMapOptionalAttributes

          public SMFSchema.Builder setMapOptionalAttributes(javaslang.collection.Map<SMFAttributeName,SMFSchemaAttribute> in_map)

    - #### setEntriesOptionalAttributes

          public SMFSchema.Builder setEntriesOptionalAttributes(Iterable<javaslang.Tuple2<SMFAttributeName,SMFSchemaAttribute>> entries)

    - #### setRequiredCoordinateSystem

          public final SMFSchema.Builder setRequiredCoordinateSystem(SMFCoordinateSystem requiredCoordinateSystem)

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

    - #### setRequiredCoordinateSystem

          public final SMFSchema.Builder setRequiredCoordinateSystem(Optional<? extends SMFCoordinateSystem> requiredCoordinateSystem)

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

    - #### setAllowExtraAttributes

          public final SMFSchema.Builder setAllowExtraAttributes(boolean allowExtraAttributes)

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

    - #### build

          public SMFSchema build()

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

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