Package com.nimbusds.oauth2.sdk.id
Class Identifier
java.lang.Object
com.nimbusds.oauth2.sdk.id.Identifier
- All Implemented Interfaces:
Serializable
,Comparable<Identifier>
,net.minidev.json.JSONAware
- Direct Known Subclasses:
AccessTokenType
,ACR
,Action
,AMR
,Audience
,AuthorizationCode
,AuthorizedParty
,AuthorizedParty
,AuthRequestID
,BackChannelTokenDeliveryMode
,ClientAuthenticationMethod
,ClientID
,ClientRegistrationType
,CodeChallenge
,CodeChallengeMethod
,CountryCode
,DataType
,DeviceCode
,DocumentNumber
,DocumentType
,DPoPIssuer
,ElectronicRecordType
,EndpointName
,EntityID
,EntityType
,Gender
,GrantType
,HashAlgorithm
,HashClaim
,IDDocumentType
,IdentifierWithOptionalURIRepresentation
,IdentityAssuranceLevel
,IdentityEvidenceType
,IdentityTrustFramework
,IdentityVerificationMethod
,Issuer
,Jurisdiction
,JWTID
,MSISDN
,Name
,Nonce
,Occupation
,OperationName
,Organization
,PersonalNumber
,Policy
,Privilege
,Procedure
,ReferenceNumber
,ResponseMode
,ResponseType.Value
,Scope.Value
,SectorID
,SerialNumber
,SessionID
,SignatureType
,SoftwareID
,SoftwareVersion
,State
,Status
,Subject
,Token
,TXN
,UserCode
,ValidationMethodType
,VerificationMethodType
,VerificationProcess
,VouchType
public class Identifier
extends Object
implements Serializable, Comparable<Identifier>, net.minidev.json.JSONAware
The base class for representing identifiers. Provides constructors that
generate Base64URL-encoded secure random identifier values.
Extending classes must override the equals(java.lang.Object)
method.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
The default byte length of generated identifiers.protected static final SecureRandom
The secure random generator. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new identifier with a randomly generated 256-bit (32-byte) value, Base64URL-encoded.Identifier
(int byteLength) Creates a new identifier with a randomly generated value of the specified byte length, Base64URL-encoded.Identifier
(String value) Creates a new identifier with the specified value. -
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(Identifier other) boolean
getValue()
Returns the value of this identifier.int
hashCode()
Returns the JSON string representation of this identifier.toString()
toStringList
(Collection<? extends Identifier> ids) Returns a string list representation of the specified identifier collection.
-
Field Details
-
DEFAULT_BYTE_LENGTH
The default byte length of generated identifiers.- See Also:
-
secureRandom
The secure random generator.
-
-
Constructor Details
-
Identifier
Creates a new identifier with the specified value.- Parameters:
value
- The value. Must not benull
or empty string.
-
Identifier
Creates a new identifier with a randomly generated value of the specified byte length, Base64URL-encoded.- Parameters:
byteLength
- The byte length of the value to generate. Must be greater than one.
-
Identifier
public Identifier()Creates a new identifier with a randomly generated 256-bit (32-byte) value, Base64URL-encoded.
-
-
Method Details
-
toStringList
Returns a string list representation of the specified identifier collection. Omitsnull
items in the collection.- Parameters:
ids
- The identifiers,null
if not specified.- Returns:
- The string list, empty list if not specified.
-
getValue
Returns the value of this identifier.- Returns:
- The value.
-
toJSONString
Returns the JSON string representation of this identifier.- Specified by:
toJSONString
in interfacenet.minidev.json.JSONAware
- Returns:
- The JSON string.
-
toString
-
compareTo
- Specified by:
compareTo
in interfaceComparable<Identifier>
-
equals
-
hashCode
-