Package 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:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final Comparator<MemberVersion>
Version comparator that takes into account only major & minor version, disregarding patch version number.static final MemberVersion
UNKNOWN version. -
Constructor Summary
ConstructorDescriptionMemberVersion
(int major, int minor, int patch) MemberVersion
(String version) -
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(MemberVersion otherVersion) boolean
int
Returns type identifier for this class.int
Returns DataSerializableFactory factory ID for this class.byte
getMajor()
byte
getMinor()
byte
getPatch()
int
hashCode()
boolean
isGreaterOrEqual
(MemberVersion version) boolean
static MemberVersion
of
(int major, int minor, int patch) static MemberVersion
void
Reads fields from the input streamtoString()
void
Writes object fields to output stream
-
Field Details
-
UNKNOWN
UNKNOWN version. -
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
-
-
Method Details
-
getMajor
public byte getMajor() -
getMinor
public byte getMinor() -
getPatch
public byte getPatch() -
isUnknown
public boolean isUnknown() -
equals
-
hashCode
public int hashCode() -
toString
-
writeData
Description copied from interface:DataSerializable
Writes object fields to output stream- Specified by:
writeData
in interfaceDataSerializable
- Parameters:
out
- output- Throws:
IOException
- if an I/O error occurs. In particular, anIOException
may be thrown if the output stream has been closed.
-
readData
Description copied from interface:DataSerializable
Reads fields from the input stream- Specified by:
readData
in interfaceDataSerializable
- Parameters:
in
- input- Throws:
IOException
- if an I/O error occurs. In particular, anIOException
may be thrown if the input stream has been closed.
-
of
-
of
-
getFactoryId
public int getFactoryId()Description copied from interface:IdentifiedDataSerializable
Returns DataSerializableFactory factory ID for this class.- Specified by:
getFactoryId
in interfaceIdentifiedDataSerializable
- 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 interfaceIdentifiedDataSerializable
- Returns:
- type ID
-
compareTo
- Specified by:
compareTo
in interfaceComparable<MemberVersion>
-
asVersion
- Returns:
- a
Version
initialized with thisMemberVersion
's major.minor version.
-
isGreaterOrEqual
- Parameters:
version
- other version to compare to- Returns:
true
if this version is greater than or equal toversion
-