Package com.io7m.smfj.core

## Class SMFFormatVersion

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

- All Implemented Interfaces:
    `SMFFormatVersionType`, `java.lang.Comparable<SMFFormatVersionType>`

      public final class SMFFormatVersion
      extends java.lang.Object
      implements SMFFormatVersionType

  A format version.

- - ### Nested Class Summary

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

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static SMFFormatVersion.Builder` | `builder()` | Creates a builder for `SMFFormatVersion`.
    `static SMFFormatVersion` | `copyOf​(SMFFormatVersionType instance)` | Creates an immutable copy of a `SMFFormatVersionType` value.
    `boolean` | `equals​(java.lang.Object another)` | This instance is equal to all instances of `SMFFormatVersion` that have equal attribute values.
    `int` | `hashCode()` | Computes a hash code from attributes: `major`, `minor`.
    `int` | `major()` |
    `int` | `minor()` |
    `static SMFFormatVersion` | `of​(int major, int minor)` | Construct a new immutable `SMFFormatVersion` instance.
    `java.lang.String` | `toString()` | Prints the immutable value `SMFFormatVersion` with attribute values.
    `SMFFormatVersion` | `withMajor​(int value)` | Copy the current immutable object by setting a value for the `major` attribute.
    `SMFFormatVersion` | `withMinor​(int value)` | Copy the current immutable object by setting a value for the `minor` attribute.

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

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

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

      `compareTo, toHumanString`

- - ### Method Detail

    - #### major

          public int major()

      Specified by:
        `major` in interface `SMFFormatVersionType`
      Returns:
        The major number for a format

    - #### minor

          public int minor()

      Specified by:
        `minor` in interface `SMFFormatVersionType`
      Returns:
        The minor number for a format

    - #### withMajor

          public final SMFFormatVersion withMajor​(int value)

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

    - #### withMinor

          public final SMFFormatVersion withMinor​(int value)

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

    - #### equals

          public boolean equals​(java.lang.Object another)

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

    - #### hashCode

          public int hashCode()

      Computes a hash code from attributes: `major`, `minor`.
      Overrides:
        `hashCode` in class `java.lang.Object`
      Returns:
        hashCode value

    - #### toString

          public java.lang.String toString()

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

    - #### of

          public static SMFFormatVersion of​(int major,
                                            int minor)

      Construct a new immutable `SMFFormatVersion` instance.
      Parameters:
        `major` - The value for the `major` attribute
        `minor` - The value for the `minor` attribute
      Returns:
        An immutable SMFFormatVersion instance

    - #### copyOf

          public static SMFFormatVersion copyOf​(SMFFormatVersionType instance)

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

    - #### builder

          public static SMFFormatVersion.Builder builder()

      Creates a builder for `SMFFormatVersion`.

           SMFFormatVersion.builder()
              .setMajor(int) // required major
              .setMinor(int) // required minor
              .build();

      Returns:
        A new SMFFormatVersion builder