com.io7m.smfj.validation.api

## Class SMFSchema

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

- All Implemented Interfaces:
    SMFSchemaType

      @Generated(value={"Immutables.generator","SMFSchemaType"})
      public final class SMFSchema
      extends Object
      implements SMFSchemaType

  The type of schemas.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `SMFSchema.Builder` Builds instances of type `SMFSchema`.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `allowExtraAttributes()`
    `static SMFSchema.Builder` | `builder()` Creates a builder for `SMFSchema`.
    `static SMFSchema` | `copyOf(SMFSchemaType instance)` Creates an immutable copy of a `SMFSchemaType` value.
    `boolean` | `equals(Object another)` This instance is equal to all instances of `SMFSchema` that have equal attribute values.
    `int` | `hashCode()` Computes a hash code from attributes: `schemaIdentifier`, `requiredAttributes`, `optionalAttributes`, `requiredCoordinateSystem`, `allowExtraAttributes`.
    `static SMFSchema` | `of(SMFSchemaIdentifier schemaIdentifier, javaslang.collection.SortedMap<SMFAttributeName,SMFSchemaAttribute> requiredAttributes, javaslang.collection.SortedMap<SMFAttributeName,SMFSchemaAttribute> optionalAttributes, Optional<SMFCoordinateSystem> requiredCoordinateSystem, boolean allowExtraAttributes)` Construct a new immutable `SMFSchema` instance.
    `javaslang.collection.SortedMap<SMFAttributeName,SMFSchemaAttribute>` | `optionalAttributes()` A schema may define optional attributes.
    `javaslang.collection.SortedMap<SMFAttributeName,SMFSchemaAttribute>` | `requiredAttributes()` A schema may define required attributes.
    `Optional<SMFCoordinateSystem>` | `requiredCoordinateSystem()`
    `SMFSchemaIdentifier` | `schemaIdentifier()`
    `String` | `toString()` Prints the immutable value `SMFSchema` with attribute values.
    `SMFSchema` | `withAllowExtraAttributes(boolean value)` Copy the current immutable object by setting a value for the `allowExtraAttributes` attribute.
    `SMFSchema` | `withOptionalAttributes(javaslang.collection.SortedMap<SMFAttributeName,SMFSchemaAttribute> value)`
    `SMFSchema` | `withRequiredAttributes(javaslang.collection.SortedMap<SMFAttributeName,SMFSchemaAttribute> value)`
    `SMFSchema` | `withRequiredCoordinateSystem(Optional<? extends SMFCoordinateSystem> optional)` Copy the current immutable object by setting an optional value for the `requiredCoordinateSystem` attribute.
    `SMFSchema` | `withRequiredCoordinateSystem(SMFCoordinateSystem value)` Copy the current immutable object by setting a present value for the optional `requiredCoordinateSystem` attribute.
    `SMFSchema` | `withSchemaIdentifier(SMFSchemaIdentifier value)` Copy the current immutable object by setting a value for the `schemaIdentifier` attribute.

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

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface com.io7m.smfj.validation.api.SMFSchemaType

      `checkPreconditions`

- - ### Method Detail

    - #### schemaIdentifier

          public SMFSchemaIdentifier schemaIdentifier()

      Specified by:
        `schemaIdentifier` in interface `SMFSchemaType`
      Returns:
        The unique schema identifier

    - #### requiredAttributes

          public javaslang.collection.SortedMap<SMFAttributeName,SMFSchemaAttribute> requiredAttributes()

      A schema may define required attributes. An attribute is not allowed to be both required and optional at the same time.
      Specified by:
        `requiredAttributes` in interface `SMFSchemaType`
      Returns:
        The required attributes

    - #### optionalAttributes

          public javaslang.collection.SortedMap<SMFAttributeName,SMFSchemaAttribute> optionalAttributes()

      A schema may define optional attributes. An attribute is not allowed to be both required and optional at the same time.
      Specified by:
        `optionalAttributes` in interface `SMFSchemaType`
      Returns:
        The optional attributes

    - #### requiredCoordinateSystem

          public Optional<SMFCoordinateSystem> requiredCoordinateSystem()

      Specified by:
        `requiredCoordinateSystem` in interface `SMFSchemaType`
      Returns:
        The required coordinate system, if any

    - #### allowExtraAttributes

          public boolean allowExtraAttributes()

      Specified by:
        `allowExtraAttributes` in interface `SMFSchemaType`
      Returns:
        `true` iff the mesh is allowed to contain attributes that are not given in `requiredAttributes()`

    - #### withSchemaIdentifier

          public final SMFSchema withSchemaIdentifier(SMFSchemaIdentifier value)

      Copy the current immutable object by setting a value for the `schemaIdentifier` attribute. A shallow reference equality check is used to prevent copying of the same value by returning `this`.
      Parameters:
        `value` - A new value for schemaIdentifier
      Returns:
        A modified copy of the `this` object

    - #### withRequiredAttributes

          public SMFSchema withRequiredAttributes(javaslang.collection.SortedMap<SMFAttributeName,SMFSchemaAttribute> value)

    - #### withOptionalAttributes

          public SMFSchema withOptionalAttributes(javaslang.collection.SortedMap<SMFAttributeName,SMFSchemaAttribute> value)

    - #### withRequiredCoordinateSystem

          public final SMFSchema withRequiredCoordinateSystem(SMFCoordinateSystem value)

      Copy the current immutable object by setting a present value for the optional `requiredCoordinateSystem` attribute.
      Parameters:
        `value` - The value for requiredCoordinateSystem
      Returns:
        A modified copy of `this` object

    - #### withRequiredCoordinateSystem

          public final SMFSchema withRequiredCoordinateSystem(Optional<? extends SMFCoordinateSystem> optional)

      Copy the current immutable object by setting an optional value for the `requiredCoordinateSystem` attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning `this`.
      Parameters:
        `optional` - A value for requiredCoordinateSystem
      Returns:
        A modified copy of `this` object

    - #### withAllowExtraAttributes

          public final SMFSchema withAllowExtraAttributes(boolean value)

      Copy the current immutable object by setting a value for the `allowExtraAttributes` attribute. A value equality check is used to prevent copying of the same value by returning `this`.
      Parameters:
        `value` - A new value for allowExtraAttributes
      Returns:
        A modified copy of the `this` object

    - #### equals

          public boolean equals(Object another)

      This instance is equal to all instances of `SMFSchema` that have equal attribute values.
      Overrides:
        `equals` in class `Object`
      Returns:
        `true` if `this` is equal to `another` instance

    - #### hashCode

          public int hashCode()

      Computes a hash code from attributes: `schemaIdentifier`, `requiredAttributes`, `optionalAttributes`, `requiredCoordinateSystem`, `allowExtraAttributes`.
      Overrides:
        `hashCode` in class `Object`
      Returns:
        hashCode value

    - #### toString

          public String toString()

      Prints the immutable value `SMFSchema` with attribute values.
      Overrides:
        `toString` in class `Object`
      Returns:
        A string representation of the value

    - #### of

          public static SMFSchema of(SMFSchemaIdentifier schemaIdentifier,
                                     javaslang.collection.SortedMap<SMFAttributeName,SMFSchemaAttribute> requiredAttributes,
                                     javaslang.collection.SortedMap<SMFAttributeName,SMFSchemaAttribute> optionalAttributes,
                                     Optional<SMFCoordinateSystem> requiredCoordinateSystem,
                                     boolean allowExtraAttributes)

      Construct a new immutable `SMFSchema` instance.
      Parameters:
        `schemaIdentifier` - The value for the `schemaIdentifier` attribute
        `requiredAttributes` - The value for the `requiredAttributes` attribute
        `optionalAttributes` - The value for the `optionalAttributes` attribute
        `requiredCoordinateSystem` - The value for the `requiredCoordinateSystem` attribute
        `allowExtraAttributes` - The value for the `allowExtraAttributes` attribute
      Returns:
        An immutable SMFSchema instance

    - #### copyOf

          public static SMFSchema copyOf(SMFSchemaType instance)

      Creates an immutable copy of a `SMFSchemaType` value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
      Parameters:
        `instance` - The instance to copy
      Returns:
        A copied immutable SMFSchema instance

    - #### builder

          public static SMFSchema.Builder builder()

      Creates a builder for `SMFSchema`.
      Returns:
        A new SMFSchema builder

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