com.nimbusds.oauth2.sdk.id
Class Identifier

java.lang.Object
  extended by com.nimbusds.oauth2.sdk.id.Identifier
All Implemented Interfaces:
net.minidev.json.JSONAware
Direct Known Subclasses:
AccessTokenHash, AccessTokenType, ACR, Audience, AuthorizationCode, AuthorizedParty, ClientAuthenticationMethod, ClientID, CodeHash, Gender, GrantType, Issuer, JWTID, Nonce, ResponseType, ScopeToken, State, Subject, Token

public abstract class Identifier
extends Object
implements net.minidev.json.JSONAware

The base abstract class for representing identifiers and identities. Provides constructors that generate random identifier values made up of mixed-case alphanumeric ASCII characters.

Extending classes must override the equals(java.lang.Object) method.

Version:
$version$ (2013-02-04)
Author:
Vladimir Dzhuvinov

Constructor Summary
Identifier()
          Creates a new identifier with a randomly generated value.
Identifier(int length)
          Creates a new identifier with a randomly generated value of the specified length.
Identifier(String value)
          Creates a new identifier with the specified value.
 
Method Summary
abstract  boolean equals(Object object)
          Overrides Object.equals().
 String getValue()
          Gets the value of this identifier.
 int hashCode()
          Overrides Object.hashCode().
 String toJSONString()
          Returns the JSON string representation of this identifier.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Identifier

public Identifier(String value)
Creates a new identifier with the specified value.

Parameters:
value - The identifier value. Must not be null or empty string.

Identifier

public Identifier(int length)
Creates a new identifier with a randomly generated value of the specified length. The value will be made up of mixed-case alphanumeric ASCII characters.

Parameters:
length - The number of characters. Must be a positive integer.

Identifier

public Identifier()
Creates a new identifier with a randomly generated value. The value will be made up of 32 mixed-case alphanumeric ASCII characters.

Method Detail

getValue

public String getValue()
Gets the value of this identifier.

Returns:
The value.

toJSONString

public String toJSONString()
Returns the JSON string representation of this identifier.

Specified by:
toJSONString in interface net.minidev.json.JSONAware
Returns:
The JSON string.

toString

public String toString()
Overrides:
toString in class Object
See Also:
getValue()

hashCode

public int hashCode()
Overrides Object.hashCode().

Overrides:
hashCode in class Object
Returns:
The object hash code.

equals

public abstract boolean equals(Object object)
Overrides Object.equals().

Overrides:
equals in class Object
Parameters:
object - The object to compare to.
Returns:
true if the objects have the same value, otherwise false.


Copyright © 2013 NimbusDS. All Rights Reserved.