com.io7m.smfj.format.binary

## Class SMFBSection

- java.lang.Object
- - com.io7m.smfj.format.binary.SMFBSection

- All Implemented Interfaces:
    SMFBSectionType

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

  A parsed section.

- - ### Nested Class Summary

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

  - ### Field Summary

    - ### Fields inherited from interface com.io7m.smfj.format.binary.SMFBSectionType

      `SECTION_ALIGNMENT`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static SMFBSection.Builder` | `builder()` Creates a builder for `SMFBSection`.
    `static SMFBSection` | `copyOf(SMFBSectionType instance)` Creates an immutable copy of a `SMFBSectionType` value.
    `boolean` | `equals(Object another)` This instance is equal to all instances of `SMFBSection` that have equal attribute values.
    `int` | `hashCode()` Computes a hash code from attributes: `id`, `sizeOfData`, `offset`, `sizeTotal`.
    `long` | `id()`
    `static SMFBSection` | `of(long id, long sizeOfData, long offset)` Construct a new immutable `SMFBSection` instance.
    `long` | `offset()`
    `long` | `sizeOfData()` The size of the section data, not including the magic number or this size value.
    `long` | `sizeTotal()`
    `String` | `toString()` Prints the immutable value `SMFBSection` with attribute values.
    `SMFBSection` | `withId(long value)` Copy the current immutable object by setting a value for the `id` attribute.
    `SMFBSection` | `withOffset(long value)` Copy the current immutable object by setting a value for the `offset` attribute.
    `SMFBSection` | `withSizeOfData(long value)` Copy the current immutable object by setting a value for the `sizeOfData` attribute.

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

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

    - ### Methods inherited from interface com.io7m.smfj.format.binary.SMFBSectionType

      `checkPreconditions`

- - ### Method Detail

    - #### id

          public long id()

      Specified by:
        `id` in interface `SMFBSectionType`
      Returns:
        The identifier of this section

    - #### sizeOfData

          public long sizeOfData()

      The size of the section data, not including the magic number or this size value.

      `sizeOfData() + 8 + 8` must be a multiple of `SMFBSectionType.SECTION_ALIGNMENT`

      Specified by:
        `sizeOfData` in interface `SMFBSectionType`
      Returns:
        The size of this section

    - #### offset

          public long offset()

      Specified by:
        `offset` in interface `SMFBSectionType`
      Returns:
        The absolute offset of the start of the section

    - #### sizeTotal

          public long sizeTotal()

      Specified by:
        `sizeTotal` in interface `SMFBSectionType`
      Returns:
        The total size of the section: The size of the data plus the header

    - #### withId

          public final SMFBSection withId(long value)

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

    - #### withSizeOfData

          public final SMFBSection withSizeOfData(long value)

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

    - #### withOffset

          public final SMFBSection withOffset(long value)

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

    - #### equals

          public boolean equals(Object another)

      This instance is equal to all instances of `SMFBSection` 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: `id`, `sizeOfData`, `offset`, `sizeTotal`.
      Overrides:
        `hashCode` in class `Object`
      Returns:
        hashCode value

    - #### toString

          public String toString()

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

    - #### of

          public static SMFBSection of(long id,
                                       long sizeOfData,
                                       long offset)

      Construct a new immutable `SMFBSection` instance.
      Parameters:
        `id` - The value for the `id` attribute
        `sizeOfData` - The value for the `sizeOfData` attribute
        `offset` - The value for the `offset` attribute
      Returns:
        An immutable SMFBSection instance

    - #### copyOf

          public static SMFBSection copyOf(SMFBSectionType instance)

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

    - #### builder

          public static SMFBSection.Builder builder()

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

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