com.io7m.smfj.core

## Class SMFAttribute

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

- All Implemented Interfaces:
    SMFAttributeType

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

  An attribute.

- - ### Nested Class Summary

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

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static SMFAttribute.Builder` | `builder()` Creates a builder for `SMFAttribute`.
    `int` | `componentCount()`
    `int` | `componentSizeBits()`
    `int` | `componentSizeOctets()`
    `SMFComponentType` | `componentType()`
    `static SMFAttribute` | `copyOf(SMFAttributeType instance)` Creates an immutable copy of a `SMFAttributeType` value.
    `boolean` | `equals(Object another)` This instance is equal to all instances of `SMFAttribute` that have equal attribute values.
    `int` | `hashCode()` Computes a hash code from attributes: `name`, `componentType`, `componentCount`, `componentSizeBits`, `componentSizeOctets`, `sizeOctets`.
    `SMFAttributeName` | `name()`
    `static SMFAttribute` | `of(SMFAttributeName name, SMFComponentType componentType, int componentCount, int componentSizeBits)` Construct a new immutable `SMFAttribute` instance.
    `int` | `sizeOctets()`
    `String` | `toString()` Prints the immutable value `SMFAttribute` with attribute values.
    `SMFAttribute` | `withComponentCount(int value)` Copy the current immutable object by setting a value for the `componentCount` attribute.
    `SMFAttribute` | `withComponentSizeBits(int value)` Copy the current immutable object by setting a value for the `componentSizeBits` attribute.
    `SMFAttribute` | `withComponentType(SMFComponentType value)` Copy the current immutable object by setting a value for the `componentType` attribute.
    `SMFAttribute` | `withName(SMFAttributeName value)` Copy the current immutable object by setting a value for the `name` attribute.

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

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

    - ### Methods inherited from interface com.io7m.smfj.core.SMFAttributeType

      `checkPreconditions`

- - ### Method Detail

    - #### name

          public SMFAttributeName name()

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

    - #### componentType

          public SMFComponentType componentType()

      Specified by:
        `componentType` in interface `SMFAttributeType`
      Returns:
        The kind of components that make up the attribute

    - #### componentCount

          public int componentCount()

      Specified by:
        `componentCount` in interface `SMFAttributeType`
      Returns:
        The number of components in the attribute

    - #### componentSizeBits

          public int componentSizeBits()

      Specified by:
        `componentSizeBits` in interface `SMFAttributeType`
      Returns:
        The size of a single component in bits

    - #### componentSizeOctets

          public int componentSizeOctets()

      Specified by:
        `componentSizeOctets` in interface `SMFAttributeType`
      Returns:
        The size of a single component in octets

    - #### sizeOctets

          public int sizeOctets()

      Specified by:
        `sizeOctets` in interface `SMFAttributeType`
      Returns:
        The size of the attribute in octets

    - #### withName

          public final SMFAttribute 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

    - #### withComponentType

          public final SMFAttribute withComponentType(SMFComponentType value)

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

    - #### withComponentCount

          public final SMFAttribute withComponentCount(int value)

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

    - #### withComponentSizeBits

          public final SMFAttribute withComponentSizeBits(int value)

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

    - #### equals

          public boolean equals(Object another)

      This instance is equal to all instances of `SMFAttribute` 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`, `componentType`, `componentCount`, `componentSizeBits`, `componentSizeOctets`, `sizeOctets`.
      Overrides:
        `hashCode` in class `Object`
      Returns:
        hashCode value

    - #### toString

          public String toString()

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

    - #### of

          public static SMFAttribute of(SMFAttributeName name,
                                        SMFComponentType componentType,
                                        int componentCount,
                                        int componentSizeBits)

      Construct a new immutable `SMFAttribute` instance.
      Parameters:
        `name` - The value for the `name` attribute
        `componentType` - The value for the `componentType` attribute
        `componentCount` - The value for the `componentCount` attribute
        `componentSizeBits` - The value for the `componentSizeBits` attribute
      Returns:
        An immutable SMFAttribute instance

    - #### copyOf

          public static SMFAttribute copyOf(SMFAttributeType instance)

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

    - #### builder

          public static SMFAttribute.Builder builder()

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

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