10Duke Java Core
Loading...
Searching...
No Matches
tenduke.sdk.core.model.jwt.JwtToken Class Reference

Detailed Description

An extension of the JwtMap which contains the raw token and methods that enable usage of the JwtClaim objects.

This class does not extract the token at any point but is capable of holding it instead.

Public Member Functions

 JwtToken ()
 Creates a new instance.
 
 JwtToken (final String rawToken)
 Creates a new instance with a caller defined value for the token in String format.
 
 JwtToken (final String rawToken, final Map< String, ?> map)
 Creates a new instance with a caller defined value for the token in String format and claims initializes from the map.
 
Object put (final JwtClaim claim, final Object value)
 Put method of the JwtMap which enables usage of the JwtClaim for providing the correct object type and key.
 
Object put (final String s, final Object o)
 
UUID mapOptionalClaimToUuid (final String claim)
 
String mapOptionalClaimToString (final String claim)
 

Protected Member Functions

void setValue (final JwtClaim claim, final String value)
 Set method of the JwtMap which enables usage of the JwtClaim for providing the correct object type and key.
 
Object setDateAsSeconds (final JwtClaim claim, final Date date)
 Uses set method of the underlying JwtMap to set the given date as seconds since EPOCH and by utilizing JwtClaim to provide the key.
 

Constructor & Destructor Documentation

◆ JwtToken() [1/3]

tenduke.sdk.core.model.jwt.JwtToken.JwtToken ( )

Creates a new instance.

◆ JwtToken() [2/3]

tenduke.sdk.core.model.jwt.JwtToken.JwtToken ( final String rawToken)

Creates a new instance with a caller defined value for the token in String format.

Parameters
rawTokenraw JWT as a string.

◆ JwtToken() [3/3]

tenduke.sdk.core.model.jwt.JwtToken.JwtToken ( final String rawToken,
final Map< String, ?> map )

Creates a new instance with a caller defined value for the token in String format and claims initializes from the map.

Parameters
rawTokenraw JWT as a string.
mapparsed values of the JWT as a map.

Member Function Documentation

◆ put() [1/2]

Object tenduke.sdk.core.model.jwt.JwtToken.put ( final JwtClaim claim,
final Object value )

Put method of the JwtMap which enables usage of the JwtClaim for providing the correct object type and key.

Parameters
claimfor providing the key and type to use.
valueto be saved in the map.
Returns
saved value.

◆ put() [2/2]

Object tenduke.sdk.core.model.jwt.JwtToken.put ( final String s,
final Object o )

If value is a date and listed in StandardJwtClaims#isSpecDate(java.lang.String), the value will be put into the map as seconds by using the method setDateAsSeconds(java.lang.String, java.util.Date)

◆ setDateAsSeconds()

Object tenduke.sdk.core.model.jwt.JwtToken.setDateAsSeconds ( final JwtClaim claim,
final Date date )
protected

Uses set method of the underlying JwtMap to set the given date as seconds since EPOCH and by utilizing JwtClaim to provide the key.

Parameters
claimto provide the key to be used for the map.
dateto be converted to seconds and added into the map.
Returns
value that was set to the map.

◆ setValue()

void tenduke.sdk.core.model.jwt.JwtToken.setValue ( final JwtClaim claim,
final String value )
protected

Set method of the JwtMap which enables usage of the JwtClaim for providing the correct object type and key.

Parameters
claimfor providing the key and type to use.
valueto be saved in the map.

The documentation for this class was generated from the following file: