Modifier and Type | Field and Description |
---|---|
static Version |
ONE_FIVE |
static Version |
ONE_FOUR |
static Version |
ONE_ONE |
static Version |
ONE_THREE |
static Version |
ONE_TWO |
static Version |
ONE_ZERO
in order to not have to create identical object within each message type
|
Constructor and Description |
---|
Version(int fullVersion)
Creates a Version object from a full numeric version indicator
|
Version(short majorVersion,
short minorVersion)
Creates a Version object from the given major and minor version numbers.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Version o) |
boolean |
equals(java.lang.Object obj) |
int |
getFullVersion()
Gets the full numeric indicator of the version value.
|
Version |
getLowest(Version otherVersion)
Compares two SIRA_PRISE Version indicators and returns the lowest (which is the one whose spec can be expected to define the functionality that the two versions have in common).
|
short |
getMajorVersion()
Gets The major version
|
short |
getMinorVersion()
Gets The minor version
|
int |
hashCode() |
boolean |
isAtLeast(short majorVersion2,
short minorVersion2)
Checks whether this version indicates a version that is at least (i.e the same, or later than) the one indicated by the given arguments
|
boolean |
isAtLeast(Version otherVersion)
Checks whether this version indicates a version that is at least (i.e the same, or later than) the one indicated by the given arguments
|
boolean |
isBefore(short majorVersion2,
short minorVersion2)
Checks whether this version indicates an earlier version than the one indicated by the given arguments
|
boolean |
isBefore(Version otherVersion)
Checks if this Version object designates an earlier version than the other one
|
java.lang.String |
toString() |
public static final Version ONE_FIVE
public static final Version ONE_FOUR
public static final Version ONE_ONE
public static final Version ONE_THREE
public static final Version ONE_TWO
public static final Version ONE_ZERO
public Version(int fullVersion)
fullVersion
- A full numeric version indicator holding the major version number in its first two bytes and the minor version in its last two bytes.public Version(short majorVersion, short minorVersion)
majorVersion
- The major versionminorVersion
- The minor versionpublic final int compareTo(Version o)
compareTo
in interface java.lang.Comparable<Version>
public final boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public final int getFullVersion()
public final Version getLowest(Version otherVersion)
otherVersion
- the other SIRA_PRISE Version indicatorpublic final short getMajorVersion()
public final short getMinorVersion()
public final int hashCode()
hashCode
in class java.lang.Object
public final boolean isAtLeast(short majorVersion2, short minorVersion2)
majorVersion2
- The major version number to which this version is to be comparedminorVersion2
- The minor version number to which this version is to be comparedpublic final boolean isAtLeast(Version otherVersion)
otherVersion
- A Version object designating another SIRA_PRISE version this one is to be compared to.public final boolean isBefore(short majorVersion2, short minorVersion2)
majorVersion2
- The major version number to which this version is to be comparedminorVersion2
- The minor version number to which this version is to be comparedpublic final boolean isBefore(Version otherVersion)
otherVersion
- A Version object designating another SIRA_PRISE version this one is to be compared to for "earlierness".public final java.lang.String toString()
toString
in class java.lang.Object