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,DeviceSecret,DeviceSecretHash,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 intThe default byte length of generated identifiers.protected static final SecureRandomThe 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 TypeMethodDescriptionintcompareTo(Identifier other) booleangetValue()Returns the value of this identifier.inthashCode()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 benullor 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. Omitsnullitems in the collection.- Parameters:
ids- The identifiers,nullif 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:
toJSONStringin interfacenet.minidev.json.JSONAware- Returns:
- The JSON string.
-
toString
-
compareTo
- Specified by:
compareToin interfaceComparable<Identifier>
-
equals
-
hashCode
-