com.io7m.smfj.validation.api

## Class SMFSchemaAttribute

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

- All Implemented Interfaces:
    SMFSchemaAttributeType

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

  A schema for a specific attribute.

- - ### Nested Class Summary

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

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static SMFSchemaAttribute.Builder` | `builder()` Creates a builder for `SMFSchemaAttribute`.
    `static SMFSchemaAttribute` | `copyOf(SMFSchemaAttributeType instance)` Creates an immutable copy of a `SMFSchemaAttributeType` value.
    `boolean` | `equals(Object another)` This instance is equal to all instances of `SMFSchemaAttribute` that have equal attribute values.
    `int` | `hashCode()` Computes a hash code from attributes: `name`, `requiredComponentType`, `requiredComponentCount`, `requiredComponentSize`.
    `SMFAttributeName` | `name()`
    `static SMFSchemaAttribute` | `of(SMFAttributeName name, Optional<SMFComponentType> requiredComponentType, OptionalInt requiredComponentCount, OptionalInt requiredComponentSize)` Construct a new immutable `SMFSchemaAttribute` instance.
    `OptionalInt` | `requiredComponentCount()`
    `OptionalInt` | `requiredComponentSize()`
    `Optional<SMFComponentType>` | `requiredComponentType()`
    `String` | `toString()` Prints the immutable value `SMFSchemaAttribute` with attribute values.
    `SMFSchemaAttribute` | `withName(SMFAttributeName value)` Copy the current immutable object by setting a value for the `name` attribute.
    `SMFSchemaAttribute` | `withRequiredComponentCount(int value)` Copy the current immutable object by setting a present value for the optional `requiredComponentCount` attribute.
    `SMFSchemaAttribute` | `withRequiredComponentCount(OptionalInt optional)` Copy the current immutable object by setting an optional value for the `requiredComponentCount` attribute.
    `SMFSchemaAttribute` | `withRequiredComponentSize(int value)` Copy the current immutable object by setting a present value for the optional `requiredComponentSize` attribute.
    `SMFSchemaAttribute` | `withRequiredComponentSize(OptionalInt optional)` Copy the current immutable object by setting an optional value for the `requiredComponentSize` attribute.
    `SMFSchemaAttribute` | `withRequiredComponentType(Optional<? extends SMFComponentType> optional)` Copy the current immutable object by setting an optional value for the `requiredComponentType` attribute.
    `SMFSchemaAttribute` | `withRequiredComponentType(SMFComponentType value)` Copy the current immutable object by setting a present value for the optional `requiredComponentType` attribute.

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

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

- - ### Method Detail

    - #### name

          public SMFAttributeName name()

      Specified by:
        `name` in interface `SMFSchemaAttributeType`
      Returns:
        The name of the attribute

    - #### requiredComponentType

          public Optional<SMFComponentType> requiredComponentType()

      Specified by:
        `requiredComponentType` in interface `SMFSchemaAttributeType`
      Returns:
        The required component type, if any

    - #### requiredComponentCount

          public OptionalInt requiredComponentCount()

      Specified by:
        `requiredComponentCount` in interface `SMFSchemaAttributeType`
      Returns:
        The required component count, if any

    - #### requiredComponentSize

          public OptionalInt requiredComponentSize()

      Specified by:
        `requiredComponentSize` in interface `SMFSchemaAttributeType`
      Returns:
        The required component size in bits, if any

    - #### withName

          public final SMFSchemaAttribute withName(SMFAttributeName value)

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

    - #### withRequiredComponentType

          public final SMFSchemaAttribute withRequiredComponentType(SMFComponentType value)

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

    - #### withRequiredComponentType

          public final SMFSchemaAttribute withRequiredComponentType(Optional<? extends SMFComponentType> optional)

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

    - #### withRequiredComponentCount

          public final SMFSchemaAttribute withRequiredComponentCount(int value)

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

    - #### withRequiredComponentCount

          public final SMFSchemaAttribute withRequiredComponentCount(OptionalInt optional)

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

    - #### withRequiredComponentSize

          public final SMFSchemaAttribute withRequiredComponentSize(int value)

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

    - #### withRequiredComponentSize

          public final SMFSchemaAttribute withRequiredComponentSize(OptionalInt optional)

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

    - #### equals

          public boolean equals(Object another)

      This instance is equal to all instances of `SMFSchemaAttribute` 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: `name`, `requiredComponentType`, `requiredComponentCount`, `requiredComponentSize`.
      Overrides:
        `hashCode` in class `Object`
      Returns:
        hashCode value

    - #### toString

          public String toString()

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

    - #### of

          public static SMFSchemaAttribute of(SMFAttributeName name,
                                              Optional<SMFComponentType> requiredComponentType,
                                              OptionalInt requiredComponentCount,
                                              OptionalInt requiredComponentSize)

      Construct a new immutable `SMFSchemaAttribute` instance.
      Parameters:
        `name` - The value for the `name` attribute
        `requiredComponentType` - The value for the `requiredComponentType` attribute
        `requiredComponentCount` - The value for the `requiredComponentCount` attribute
        `requiredComponentSize` - The value for the `requiredComponentSize` attribute
      Returns:
        An immutable SMFSchemaAttribute instance

    - #### copyOf

          public static SMFSchemaAttribute copyOf(SMFSchemaAttributeType instance)

      Creates an immutable copy of a `SMFSchemaAttributeType` 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 SMFSchemaAttribute instance

    - #### builder

          public static SMFSchemaAttribute.Builder builder()

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

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