Class Version

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

public class Version extends Object
Encapsulation of AMQP protocol version
  • Constructor Summary

    Constructors
    Constructor
    Description
    Version(int major, int minor)
    Creates a new Version instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    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
    Retrieve the major version number.
    int
    Retrieve the minor version number.
    int
     
    Retrieve a String representation of the version in the standard AMQP version format of major-minor.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Version

      public Version(int major, int minor)
      Creates a new Version instance.
      Parameters:
      major - the AMQP major version number
      minor - 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

      public String toString()
      Retrieve a String representation of the version in the standard AMQP version format of major-minor.
      Overrides:
      toString in class Object
      Returns:
      a String representation of the version
      See Also:
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class 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
    • checkVersion

      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