java.lang.Object
java.lang.Record
org.htmlunit.csp.value.RFC7230Token
- Record Components:
value- the token string
Represents an RFC 7230 token value, used as the value of the
report-to CSP directive.
An RFC 7230 token is a sequence of one or more characters from the
tchar set defined in
RFC 7230 §3.2.6.
The value is preserved as-is (case-sensitive).
- Author:
- Salvation Team
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionRFC7230Token(String value) Creates an instance of aRFC7230Tokenrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static Optional<RFC7230Token>parseRFC7230Token(String value) Parses an RFC 7230 token from the given string.toString()Returns the token value as-is.value()Returns the value of thevaluerecord component.
-
Constructor Details
-
RFC7230Token
Creates an instance of aRFC7230Tokenrecord class.- Parameters:
value- the value for thevaluerecord component
-
-
Method Details
-
parseRFC7230Token
Parses an RFC 7230 token from the given string.The input must consist entirely of valid
tcharcharacters as defined in RFC 7230.- Parameters:
value- the string to parse- Returns:
- an
Optionalcontaining the parsedRFC7230Token, or empty if the value does not match the RFC 7230 token grammar
-
toString
Returns the token value as-is. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
value
Returns the value of thevaluerecord component.- Returns:
- the value of the
valuerecord component
-