Package com.rabbitmq.client.impl
Class Version
java.lang.Object
com.rabbitmq.client.impl.Version
Encapsulation of AMQP protocol version
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionadjust()
Adjust a version for spec weirdness.static boolean
checkVersion
(Version clientVersion, Version serverVersion) Check compatibility of a client and server version, from the client's perspective.boolean
int
getMajor()
Retrieve the major version number.int
getMinor()
Retrieve the minor version number.int
hashCode()
toString()
Retrieve a String representation of the version in the standard AMQP version format of major-minor.
-
Constructor Details
-
Version
public Version(int major, int minor) Creates a newVersion
instance.- Parameters:
major
- the AMQP major version numberminor
- the AMQP minor version number
-
-
Method Details
-
getMajor
public int getMajor()Retrieve the major version number.- Returns:
- the major version number
-
getMinor
public int getMinor()Retrieve the minor version number.- Returns:
- the minor version number
-
toString
Retrieve a String representation of the version in the standard AMQP version format of major-minor. -
equals
-
hashCode
public int hashCode() -
adjust
Adjust a version for spec weirdness. The AMQP 0-8 spec confusingly defines the version as 8-0. This method maps the latter to the former.- Returns:
- the adjusted
Version
-
checkVersion
Check compatibility of a client and server version, from the client's perspective.- Parameters:
clientVersion
- the clientVersion
serverVersion
- the serverVersion
- Returns:
- a
boolean
value
-