Class Socks5PrivateAuthStatus

  • All Implemented Interfaces:
    java.lang.Comparable<Socks5PrivateAuthStatus>

    public final class Socks5PrivateAuthStatus
    extends java.lang.Object
    implements java.lang.Comparable<Socks5PrivateAuthStatus>
    The status of a SOCKS5 private authentication response.

    RFC 1928 reserves method codes 0x80-0xFE for private authentication methods but does not specify the format of their subnegotiation. This class provides standard status codes for the private authentication response that follow the pattern established by the username/password authentication method in RFC 1929.

    See Also:
    RFC 1928 Section 3, RFC 1929
    • Constructor Detail

      • Socks5PrivateAuthStatus

        public Socks5PrivateAuthStatus​(int byteValue,
                                       java.lang.String name)
        Creates a new SOCKS5 private authentication status.
        Parameters:
        byteValue - The byte value representing the authentication status (0x00 for success, 0xFF for failure, or custom values)
        name - The descriptive name of this status, must not be null
        Throws:
        java.lang.NullPointerException - if the name is null
    • Method Detail

      • valueOf

        public static Socks5PrivateAuthStatus valueOf​(byte b)
        Returns the Socks5PrivateAuthStatus instance that corresponds to the specified byte value.

        This method returns a singleton instance for standard status codes:

        For any other values, a new instance is created.
        Parameters:
        b - The byte value of the SOCKS5 private authentication status
        Returns:
        The corresponding Socks5PrivateAuthStatus instance
      • byteValue

        public byte byteValue()
      • isSuccess

        public boolean isSuccess()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object