java.lang.Object
java.lang.Record
org.htmlunit.csp.value.Nonce
- Record Components:
base64ValuePart- the Base64-encoded nonce value (case-sensitive)
Represents a CSP nonce-source value, e.g.
'nonce-abc123...'.
A nonce-source consists of the keyword prefix nonce- followed by a
Base64-encoded value, all enclosed in single quotes. The prefix is parsed
case-insensitively, but the Base64 nonce value itself is case-sensitive.
- Author:
- Salvation Team
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thebase64ValuePartrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.parseNonce(String value) Parses a nonce-source from its CSP string representation.toString()Returns the CSP string representation of this nonce-source, e.g.
-
Constructor Details
-
Nonce
Creates an instance of aNoncerecord class.- Parameters:
base64ValuePart- the value for thebase64ValuePartrecord component
-
-
Method Details
-
parseNonce
Parses a nonce-source from its CSP string representation.The input must be a single-quoted string of the form
'nonce-<base64>'. The prefix is matched case-insensitively; the Base64 portion is preserved as-is. -
toString
Returns the CSP string representation of this nonce-source, e.g.'nonce-abc123...'. -
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). -
base64ValuePart
Returns the value of thebase64ValuePartrecord component.- Returns:
- the value of the
base64ValuePartrecord component
-