Package com.rabbitmq.client.impl
Class Version
- java.lang.Object
-
- com.rabbitmq.client.impl.Version
-
public class Version extends java.lang.ObjectEncapsulation of AMQP protocol version
-
-
Constructor Summary
Constructors Constructor Description Version(int major, int minor)Creates a newVersioninstance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Versionadjust()Adjust a version for spec weirdness.static booleancheckVersion(Version clientVersion, Version serverVersion)Check compatibility of a client and server version, from the client's perspective.booleanequals(java.lang.Object o)intgetMajor()Retrieve the major version number.intgetMinor()Retrieve the minor version number.inthashCode()java.lang.StringtoString()Retrieve a String representation of the version in the standard AMQP version format of major-minor.
-
-
-
Method Detail
-
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
public java.lang.String toString()
Retrieve a String representation of the version in the standard AMQP version format of major-minor.- Overrides:
toStringin classjava.lang.Object- Returns:
- a
Stringrepresentation of the version - See Also:
Object.toString()
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
adjust
public Version 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
-
-