Package com.hazelcast.version
Class MemberVersion
- java.lang.Object
-
- com.hazelcast.version.MemberVersion
-
- All Implemented Interfaces:
DataSerializable
,IdentifiedDataSerializable
,java.io.Serializable
,java.lang.Comparable<MemberVersion>
public final class MemberVersion extends java.lang.Object implements IdentifiedDataSerializable, java.io.Serializable, java.lang.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 Description static java.util.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 Description MemberVersion()
MemberVersion(int major, int minor, int patch)
MemberVersion(java.lang.String version)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Version
asVersion()
int
compareTo(MemberVersion otherVersion)
boolean
equals(java.lang.Object o)
int
getClassId()
Returns type identifier for this class.int
getFactoryId()
Returns DataSerializableFactory factory ID 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(java.lang.String version)
void
readData(ObjectDataInput in)
Reads fields from the input streamjava.lang.String
toString()
void
writeData(ObjectDataOutput out)
Writes object fields to output stream
-
-
-
Field Detail
-
UNKNOWN
public static final MemberVersion UNKNOWN
UNKNOWN version.
-
MAJOR_MINOR_VERSION_COMPARATOR
public static final transient java.util.Comparator<MemberVersion> MAJOR_MINOR_VERSION_COMPARATOR
Version comparator that takes into account only major & minor version, disregarding patch version number.
-
-
Method Detail
-
getMajor
public byte getMajor()
-
getMinor
public byte getMinor()
-
getPatch
public byte getPatch()
-
isUnknown
public boolean isUnknown()
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
writeData
public void writeData(ObjectDataOutput out) throws java.io.IOException
Description copied from interface:DataSerializable
Writes object fields to output stream- Specified by:
writeData
in interfaceDataSerializable
- Parameters:
out
- output- Throws:
java.io.IOException
- if an I/O error occurs. In particular, anIOException
may be thrown if the output stream has been closed.
-
readData
public void readData(ObjectDataInput in) throws java.io.IOException
Description copied from interface:DataSerializable
Reads fields from the input stream- Specified by:
readData
in interfaceDataSerializable
- Parameters:
in
- input- Throws:
java.io.IOException
- if an I/O error occurs. In particular, anIOException
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(java.lang.String version)
-
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
public int compareTo(MemberVersion otherVersion)
- Specified by:
compareTo
in interfacejava.lang.Comparable<MemberVersion>
-
-