public final class Version extends Object implements IdentifiedDataSerializable, Comparable<Version>
VersionAware
classes. The version is composed of two bytes,
denoting MAJOR.MINOR version. It is used to represent the Hazelcast cluster version and the serialization
version of VersionAware
classes.Modifier and Type | Field and Description |
---|---|
static Version |
UNKNOWN
Version 0.0 is UNKNOWN constant
|
static byte |
UNKNOWN_VERSION
Use 0 as major & minor values for UNKNOWN version
|
Constructor and Description |
---|
Version() |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Version o) |
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() |
int |
hashCode() |
boolean |
isBetween(Version from,
Version to)
Checks if the version is between specified version (both ends inclusive)
|
boolean |
isEqualTo(Version version) |
boolean |
isGreaterOrEqual(Version version) |
boolean |
isGreaterThan(Version version) |
boolean |
isLessOrEqual(Version version) |
boolean |
isLessThan(Version version) |
boolean |
isUnknown() |
static Version |
of(int major,
int minor) |
static Version |
of(String version)
Parse the given string to a
Version . |
void |
readData(ObjectDataInput in)
Reads fields from the input stream
|
String |
toString() |
void |
writeData(ObjectDataOutput out)
Writes object fields to output stream
|
public static final byte UNKNOWN_VERSION
public static final Version UNKNOWN
public byte getMajor()
public byte getMinor()
public void writeData(ObjectDataOutput out) throws IOException
DataSerializable
writeData
in interface DataSerializable
out
- outputIOException
public void readData(ObjectDataInput in) throws IOException
DataSerializable
readData
in interface DataSerializable
in
- inputIOException
public int compareTo(Version o)
compareTo
in interface Comparable<Version>
public int getFactoryId()
IdentifiedDataSerializable
getFactoryId
in interface IdentifiedDataSerializable
public int getId()
IdentifiedDataSerializable
getId
in interface IdentifiedDataSerializable
public static Version of(int major, int minor)
ClusterVersion
with the given major and minorpublic static Version of(String version)
Version
. This method may throw an IllegalArgumentException
version
- string to parse to Version
.Version
parsed from given argument.public boolean isEqualTo(Version version)
public boolean isGreaterThan(Version version)
public boolean isGreaterOrEqual(Version version)
public boolean isLessThan(Version version)
public boolean isLessOrEqual(Version version)
public boolean isBetween(Version from, Version to)
from
- to
- public boolean isUnknown()
Copyright © 2017 Hazelcast, Inc.. All Rights Reserved.