com.hazelcast.version

## Class MemberVersion

- java.lang.Object
- - com.hazelcast.version.MemberVersion

- All Implemented Interfaces:
    DataSerializable, IdentifiedDataSerializable, Serializable, Comparable<MemberVersion>

      public final class MemberVersion
      extends Object
      implements IdentifiedDataSerializable, Serializable, Comparable<MemberVersion>

  Determines the Hazelcast codebase version in terms of major.minor.patch version.
  Since:
    3.8
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static Comparator<MemberVersion>` | `MAJOR_MINOR_VERSION_COMPARATOR` Version comparator that takes into account only major & minor version, disregarding patch version number.
    `static MemberVersion` | `UNKNOWN` UNKNOWN version.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MemberVersion()`
    `MemberVersion(int major, int minor, int patch)`
    `MemberVersion(String version)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Version` | `asVersion()`
    `int` | `compareTo(MemberVersion otherVersion)`
    `boolean` | `equals(Object o)`
    `int` | `getFactoryId()` Returns DataSerializableFactory factory ID for this class.
    `int` | `getId()` Returns type identifier for this class.
    `byte` | `getMajor()`
    `byte` | `getMinor()`
    `byte` | `getPatch()`
    `int` | `hashCode()`
    `boolean` | `isUnknown()`
    `static MemberVersion` | `of(int major, int minor, int patch)`
    `static MemberVersion` | `of(String version)`
    `void` | `readData(ObjectDataInput in)` Reads fields from the input stream
    `String` | `toString()`
    `void` | `writeData(ObjectDataOutput out)` Writes object fields to output stream

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

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

- - ### Field Detail

    - #### UNKNOWN

          public static final MemberVersion UNKNOWN

      UNKNOWN version.

    - #### MAJOR_MINOR_VERSION_COMPARATOR

          public static final transient Comparator<MemberVersion> MAJOR_MINOR_VERSION_COMPARATOR

      Version comparator that takes into account only major & minor version, disregarding patch version number.

  - ### Constructor Detail

    - #### MemberVersion

          public MemberVersion()

    - #### MemberVersion

          public MemberVersion(int major,
                               int minor,
                               int patch)

    - #### MemberVersion

          public MemberVersion(String version)

  - ### Method Detail

    - #### getMajor

          public byte getMajor()

    - #### getMinor

          public byte getMinor()

    - #### getPatch

          public byte getPatch()

    - #### isUnknown

          public boolean isUnknown()

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### writeData

          public void writeData(ObjectDataOutput out)
                         throws IOException

      Description copied from interface: `DataSerializable`
      Writes object fields to output stream
      Specified by:
        `writeData` in interface `DataSerializable`
      Parameters:
        `out` - output
      Throws:
        `IOException` - if an I/O error occurs. In particular, an `IOException` may be thrown if the output stream has been closed.

    - #### readData

          public void readData(ObjectDataInput in)
                        throws IOException

      Description copied from interface: `DataSerializable`
      Reads fields from the input stream
      Specified by:
        `readData` in interface `DataSerializable`
      Parameters:
        `in` - input
      Throws:
        `IOException` - if an I/O error occurs. In particular, an `IOException` may be thrown if the input stream has been closed.

    - #### of

          public static MemberVersion of(int major,
                                         int minor,
                                         int patch)

    - #### of

          public static MemberVersion of(String version)

    - #### getFactoryId

          public int getFactoryId()

      Description copied from interface: `IdentifiedDataSerializable`
      Returns DataSerializableFactory factory ID for this class.
      Specified by:
        `getFactoryId` in interface `IdentifiedDataSerializable`
      Returns:
        factory ID

    - #### getId

          public int getId()

      Description copied from interface: `IdentifiedDataSerializable`
      Returns type identifier for this class. It should be unique per DataSerializableFactory.
      Specified by:
        `getId` in interface `IdentifiedDataSerializable`
      Returns:
        type ID

    - #### compareTo

          public int compareTo(MemberVersion otherVersion)

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

    - #### asVersion

          public Version asVersion()

      Returns:
        a `Version` initialized with this `MemberVersion`'s major.minor version.

Copyright © 2019. All rights reserved.