Package org.apache.ignite.lang

## Class IgniteProductVersion

- java.lang.Object
- - org.apache.ignite.lang.IgniteProductVersion

- All Implemented Interfaces:
    `Externalizable`, `Serializable`, `Comparable<IgniteProductVersion>`

      public class IgniteProductVersion
      extends Object
      implements Comparable<IgniteProductVersion>, Externalizable

  Represents node version.

  Node version can be acquired via `ClusterNode.version()` method.

  Two versions are compared in the following order: major number, minor number, maintenance number, revision timestamp.

  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static int` | `REV_HASH_SIZE` | Size of the `revHash`
    `static int` | `SIZE_IN_BYTES` | Size in bytes of serialized: 3 bytes (maj, min, maintenance version), 8 bytes - timestamp

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `IgniteProductVersion()` | Empty constructor required by `Externalizable`.
    `IgniteProductVersion​(byte major, byte minor, byte maintenance, long revTs, byte[] revHash)` |
    `IgniteProductVersion​(byte major, byte minor, byte maintenance, String stage, long revTs, byte[] revHash)` |

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `int` | `compareTo​(@NotNull IgniteProductVersion o)`
    `int` | `compareToIgnoreTimestamp​(@NotNull IgniteProductVersion o)` |
    `boolean` | `equals​(Object o)`
    `static IgniteProductVersion` | `fromString​(String verStr)` | Tries to parse product version from it's string representation.
    `boolean` | `greaterThanEqual​(int major, int minor, int maintenance)` |
    `int` | `hashCode()`
    `byte` | `maintenance()` | Gets maintenance version number.
    `byte` | `major()` | Gets major version number.
    `byte` | `minor()` | Gets minor version number.
    `void` | `readExternal​(ObjectInput in)`
    `Date` | `releaseDate()` | Gets release date.
    `byte[]` | `revisionHash()` | Gets revision hash.
    `long` | `revisionTimestamp()` | Gets revision timestamp.
    `String` | `stage()` |
    `String` | `toString()`
    `void` | `writeExternal​(ObjectOutput out)`

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

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

- - ### Field Detail

    - #### REV_HASH_SIZE

          public static final int REV_HASH_SIZE

      Size of the `revHash`
      See Also:
        Constant Field Values

    - #### SIZE_IN_BYTES

          public static final int SIZE_IN_BYTES

      Size in bytes of serialized: 3 bytes (maj, min, maintenance version), 8 bytes - timestamp
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### IgniteProductVersion

          public IgniteProductVersion()

      Empty constructor required by `Externalizable`.

    - #### IgniteProductVersion

          public IgniteProductVersion​(byte major,
                                      byte minor,
                                      byte maintenance,
                                      long revTs,
                                      byte[] revHash)

      Parameters:
        `major` - Major version number.
        `minor` - Minor version number.
        `maintenance` - Maintenance version number.
        `revTs` - Revision timestamp.
        `revHash` - Revision hash.

    - #### IgniteProductVersion

          public IgniteProductVersion​(byte major,
                                      byte minor,
                                      byte maintenance,
                                      String stage,
                                      long revTs,
                                      byte[] revHash)

      Parameters:
        `major` - Major version number.
        `minor` - Minor version number.
        `maintenance` - Maintenance version number.
        `stage` - Stage of development.
        `revTs` - Revision timestamp.
        `revHash` - Revision hash.

  - ### Method Detail

    - #### major

          public byte major()

      Gets major version number.
      Returns:
        Major version number.

    - #### minor

          public byte minor()

      Gets minor version number.
      Returns:
        Minor version number.

    - #### maintenance

          public byte maintenance()

      Gets maintenance version number.
      Returns:
        Maintenance version number.

    - #### stage

          public String stage()

      Returns:
        Stage of development.

    - #### revisionTimestamp

          public long revisionTimestamp()

      Gets revision timestamp.
      Returns:
        Revision timestamp.

    - #### revisionHash

          public byte[] revisionHash()

      Gets revision hash.
      Returns:
        Revision hash.

    - #### releaseDate

          public Date releaseDate()

      Gets release date.
      Returns:
        Release date.

    - #### greaterThanEqual

          public boolean greaterThanEqual​(int major,
                                          int minor,
                                          int maintenance)

      Parameters:
        `major` - Major version number.
        `minor` - Minor version number.
        `maintenance` - Maintenance version number.
      Returns:
        `True` if this version is greater or equal than the one passed in.

    - #### compareTo

          public int compareTo​(@NotNull
                               @NotNull IgniteProductVersion o)

      Specified by:
        `compareTo` in interface `Comparable<IgniteProductVersion>`

    - #### compareToIgnoreTimestamp

          public int compareToIgnoreTimestamp​(@NotNull
                                              @NotNull IgniteProductVersion o)

      Parameters:
        `o` - Other version.
      Returns:
        Compare result.

    - #### equals

          public boolean equals​(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### writeExternal

          public void writeExternal​(ObjectOutput out)
                             throws IOException

      Specified by:
        `writeExternal` in interface `Externalizable`
      Throws:
        `IOException`

    - #### readExternal

          public void readExternal​(ObjectInput in)
                            throws IOException,
                                   ClassNotFoundException

      Specified by:
        `readExternal` in interface `Externalizable`
      Throws:
        `IOException`
        `ClassNotFoundException`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### fromString

          public static IgniteProductVersion fromString​(String verStr)

      Tries to parse product version from it's string representation.
      Parameters:
        `verStr` - String representation of version.
      Returns:
        Product version.