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:
  • Field Details

    • UNKNOWN

      public static final MemberVersion UNKNOWN
      UNKNOWN version.
    • MAJOR_MINOR_VERSION_COMPARATOR

      public static final Comparator<MemberVersion> MAJOR_MINOR_VERSION_COMPARATOR
      Version comparator that takes into account only major & minor version, disregarding patch version number.
  • Constructor Details

    • MemberVersion

      public MemberVersion()
    • MemberVersion

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

      public MemberVersion(String version)
  • Method Details

    • 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
    • getClassId

      public int getClassId()
      Description copied from interface: IdentifiedDataSerializable
      Returns type identifier for this class. It should be unique per DataSerializableFactory.
      Specified by:
      getClassId 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.
    • isGreaterOrEqual

      public boolean isGreaterOrEqual(MemberVersion version)
      Parameters:
      version - other version to compare to
      Returns:
      true if this version is greater than or equal to version