Package io.netty.handler.codec.socksx.v5
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:
- RFC 1928 Section 3, RFC 1929
-
-
Field Summary
Fields Modifier and Type Field Description static Socks5PrivateAuthStatus
FAILURE
static Socks5PrivateAuthStatus
SUCCESS
-
Constructor Summary
Constructors Constructor Description Socks5PrivateAuthStatus(int byteValue, java.lang.String name)
Creates a new SOCKS5 private authentication status.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description byte
byteValue()
int
compareTo(Socks5PrivateAuthStatus o)
boolean
equals(java.lang.Object obj)
int
hashCode()
boolean
isSuccess()
java.lang.String
toString()
static Socks5PrivateAuthStatus
valueOf(byte b)
Returns theSocks5PrivateAuthStatus
instance that corresponds to the specified byte value.
-
-
-
Field Detail
-
SUCCESS
public static final Socks5PrivateAuthStatus SUCCESS
-
FAILURE
public static final Socks5PrivateAuthStatus FAILURE
-
-
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 theSocks5PrivateAuthStatus
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 classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
compareTo
public int compareTo(Socks5PrivateAuthStatus o)
- Specified by:
compareTo
in interfacejava.lang.Comparable<Socks5PrivateAuthStatus>
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-