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
FieldsModifier and TypeFieldDescriptionstatic final Comparator<MemberVersion>Version comparator that takes into account only major & minor version, disregarding patch version number.static final MemberVersionUNKNOWN version. -
Constructor Summary
ConstructorsConstructorDescriptionMemberVersion(int major, int minor, int patch) MemberVersion(String version) -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(MemberVersion otherVersion) booleanintReturns type identifier for this class.intReturns DataSerializableFactory factory ID for this class.bytegetMajor()bytegetMinor()bytegetPatch()inthashCode()booleanstatic MemberVersionof(int major, int minor, int patch) static MemberVersionvoidReads fields from the input streamtoString()voidWrites 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:DataSerializableWrites object fields to output stream- Specified by:
writeDatain interfaceDataSerializable- Parameters:
out- output- Throws:
IOException- if an I/O error occurs. In particular, anIOExceptionmay be thrown if the output stream has been closed.
-
readData
Description copied from interface:DataSerializableReads fields from the input stream- Specified by:
readDatain interfaceDataSerializable- Parameters:
in- input- Throws:
IOException- if an I/O error occurs. In particular, anIOExceptionmay be thrown if the input stream has been closed.
-
of
-
of
-
getFactoryId
public int getFactoryId()Description copied from interface:IdentifiedDataSerializableReturns DataSerializableFactory factory ID for this class.- Specified by:
getFactoryIdin interfaceIdentifiedDataSerializable- Returns:
- factory ID
-
getClassId
public int getClassId()Description copied from interface:IdentifiedDataSerializableReturns type identifier for this class. It should be unique per DataSerializableFactory.- Specified by:
getClassIdin interfaceIdentifiedDataSerializable- Returns:
- type ID
-
compareTo
- Specified by:
compareToin interfaceComparable<MemberVersion>
-
asVersion
- Returns:
- a
Versioninitialized with thisMemberVersion's major.minor version.
-