public class

Version

extends Object
java.lang.Object
   ↳ com.rabbitmq.client.impl.Version

Class Overview

Encapsulation of AMQP protocol version

Summary

Public Constructors
Version(int major, int minor)
Creates a new Version instance.
Public Methods
Version adjust()
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 equals(Object o)
int getMajor()
Retrieve the major version number.
int getMinor()
Retrieve the minor version number.
int hashCode()
String toString()
Retrieve a String representation of the version in the standard AMQP version format of -
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public Version (int major, int minor)

Creates a new Version instance.

Parameters
major the AMQP major version number
minor the AMQP minor version number

Public Methods

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

public static boolean checkVersion (Version clientVersion, Version serverVersion)

Check compatibility of a client and server version, from the client's perspective.

Parameters
clientVersion the client Version
serverVersion the server Version
Returns
  • a boolean value

public boolean equals (Object o)

public int getMajor ()

Retrieve the major version number.

Returns
  • the major version number

public int getMinor ()

Retrieve the minor version number.

Returns
  • the minor version number

public int hashCode ()

public String toString ()

Retrieve a String representation of the version in the standard AMQP version format of -

Returns
  • a String representation of the version
See Also