Class Socks5PrivateAuthStatus

java.lang.Object
io.netty.handler.codec.socksx.v5.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:
  • Field Details

    • SUCCESS

      public static final Socks5PrivateAuthStatus SUCCESS
    • FAILURE

      public static final Socks5PrivateAuthStatus FAILURE
    • byteValue

      private final byte byteValue
    • name

      private final java.lang.String name
    • text

      private java.lang.String text
  • Constructor Details

    • Socks5PrivateAuthStatus

      private Socks5PrivateAuthStatus(int byteValue)
    • 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 Details

    • 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
    • compareTo

      public int compareTo(Socks5PrivateAuthStatus o)
      Specified by:
      compareTo in interface java.lang.Comparable<Socks5PrivateAuthStatus>
    • toString

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