Package org.eclipse.ditto.jwt.model
Class ImmutableJsonWebToken
java.lang.Object
org.eclipse.ditto.jwt.model.AbstractJsonWebToken
org.eclipse.ditto.jwt.model.ImmutableJsonWebToken
- All Implemented Interfaces:
JsonWebToken
Immutable implementation of
JsonWebToken for standard JSON Web Tokens.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.ditto.jwt.model.JsonWebToken
JsonWebToken.JsonFields -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic JsonWebTokenfromAuthorization(String authorization) Returns a newImmutableJsonWebTokenfor the givenauthorization.static JsonWebTokenReturns a newImmutableJsonWebTokenfor the giventoken.Returns the subjects which can be used for authorization, e.g. the "sub" claim.inthashCode()toString()Methods inherited from class org.eclipse.ditto.jwt.model.AbstractJsonWebToken
getAudience, getAuthorizedParty, getBody, getExpirationTime, getHeader, getIssuer, getKeyId, getScopes, getSignature, getToken, isExpired
-
Method Details
-
fromAuthorization
Returns a newImmutableJsonWebTokenfor the givenauthorization.- Parameters:
authorization- the authorization string.- Returns:
- the ImmutableJsonWebToken.
- Throws:
NullPointerException- ifauthorizationisnull.
-
fromToken
Returns a newImmutableJsonWebTokenfor the giventoken.- Parameters:
token- the token string.- Returns:
- the ImmutableJsonWebToken.
- Throws:
NullPointerException- iftokenisnull.IllegalArgumentException- iftokenis empty.
-
getSubjects
Description copied from interface:JsonWebTokenReturns the subjects which can be used for authorization, e.g. the "sub" claim.- Returns:
- the subjects.
-
equals
- Overrides:
equalsin classAbstractJsonWebToken
-
hashCode
public int hashCode()- Overrides:
hashCodein classAbstractJsonWebToken
-
toString
- Overrides:
toStringin classAbstractJsonWebToken
-