Enum ProtocolVersion

    • Field Detail

      • MINIMUM_VERSION

        public static final ProtocolVersion MINIMUM_VERSION
        Represents the lowest supported version.
      • MAXIMUM_VERSION

        public static final ProtocolVersion MAXIMUM_VERSION
        Represents the highest supported version.
      • SUPPORTED_VERSION_STRING

        public static final java.lang.String SUPPORTED_VERSION_STRING
        The user-friendly representation of the lowest and highest supported versions.
      • ID_TO_PROTOCOL_CONSTANT

        public static final com.google.common.collect.ImmutableMap<java.lang.Integer,​ProtocolVersion> ID_TO_PROTOCOL_CONSTANT
        A map linking the protocol version number to its ProtocolVersion representation.
      • SUPPORTED_VERSIONS

        public static final java.util.Set<ProtocolVersion> SUPPORTED_VERSIONS
        A set containing all the protocols that the proxy actually supports, excluding special-purpose "versions" like LEGACY and UNKNOWN.
    • Method Detail

      • values

        public static ProtocolVersion[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (ProtocolVersion c : ProtocolVersion.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static ProtocolVersion valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • getProtocol

        public int getProtocol()
        Returns the protocol as an int.
        Returns:
        the protocol version
      • getName

        public java.lang.String getName()
        Returns the user-friendly name for this protocol.
        Returns:
        the protocol name
      • getProtocolVersion

        public static ProtocolVersion getProtocolVersion​(int protocol)
        Gets the ProtocolVersion for the given protocol.
        Parameters:
        protocol - the protocol as an int
        Returns:
        the protocol version
      • isSupported

        public static boolean isSupported​(int protocol)
        Returns whether the protocol is supported.
        Parameters:
        protocol - the protocol as an int
        Returns:
        if the protocol supported
      • isSupported

        public static boolean isSupported​(ProtocolVersion version)
        Returns whether the ProtocolVersion is supported.
        Parameters:
        version - the protocol version
        Returns:
        if the protocol supported
      • isUnknown

        public boolean isUnknown()
        Returns whether this ProtocolVersion is unknown to the proxy.
        Returns:
        if the protocol is unknown
      • isLegacy

        public boolean isLegacy()
        Returns whether this ProtocolVersion is a legacy protocol.
        Returns:
        if the protocol is legacy
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Enum<ProtocolVersion>