Package com.authlete.http
Class Token
java.lang.Object
com.authlete.http.Token
- All Implemented Interfaces:
Serializable
This class represents the token as defined in RFC 9110:
HTTP Semantics, Section 5.6.2. Tokens.
Definition
token = 1*tchar
tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*"
/ "+" / "-" / "." / "^" / "_" / "`" / "|" / "~"
/ DIGIT / ALPHA
; any VCHAR, except delimiters
Sample Code
// Parse the string as a token. Token token = Token.parse("token"); // The getValue() method returns the raw value of the token. assertEquals("token", token.getValue());
- See Also:
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Token
public Token()The default constructor. -
Token
A constructor with the raw value of this token.- Parameters:
value- The raw value of this token.
-
-
Method Details
-
getValue
-
setValue
-
equals
-
hashCode
-
toString
-
parse
Parse the input string as a token.- Parameters:
input- A string to be parsed as a token.- Returns:
- The parsed token.
- Throws:
ParseCancellationException- The input string could not be parsed successfully.
-