Package com.auth0.jwt.impl
Class NullClaim
- java.lang.Object
-
- com.auth0.jwt.impl.NullClaim
-
-
Constructor Summary
Constructors Constructor Description NullClaim()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> T
as(Class<T> tClazz)
Get this Claim as a custom type T.<T> T[]
asArray(Class<T> tClazz)
Get this Claim as an Array of type T.Boolean
asBoolean()
Get this Claim as a Boolean.Date
asDate()
Get this Claim as a Date.Double
asDouble()
Get this Claim as a Double.Integer
asInt()
Get this Claim as an Integer.<T> List<T>
asList(Class<T> tClazz)
Get this Claim as a List of type T.Long
asLong()
Get this Claim as an Long.Map<String,Object>
asMap()
Get this Claim as a generic Map of values.String
asString()
Get this Claim as a String.boolean
isNull()
Whether this Claim has a null value or not.
-
-
-
Method Detail
-
isNull
public boolean isNull()
Description copied from interface:Claim
Whether this Claim has a null value or not.
-
asBoolean
public Boolean asBoolean()
Description copied from interface:Claim
Get this Claim as a Boolean. If the value isn't of type Boolean or it can't be converted to a Boolean, null will be returned.
-
asInt
public Integer asInt()
Description copied from interface:Claim
Get this Claim as an Integer. If the value isn't of type Integer or it can't be converted to an Integer, null will be returned.
-
asLong
public Long asLong()
Description copied from interface:Claim
Get this Claim as an Long. If the value isn't of type Long or it can't be converted to an Long, null will be returned.
-
asDouble
public Double asDouble()
Description copied from interface:Claim
Get this Claim as a Double. If the value isn't of type Double or it can't be converted to a Double, null will be returned.
-
asString
public String asString()
Description copied from interface:Claim
Get this Claim as a String. If the value isn't of type String or it can't be converted to a String, null will be returned.
-
asDate
public Date asDate()
Description copied from interface:Claim
Get this Claim as a Date. If the value can't be converted to a Date, null will be returned.
-
asArray
public <T> T[] asArray(Class<T> tClazz) throws JWTDecodeException
Description copied from interface:Claim
Get this Claim as an Array of type T. If the value isn't an Array, null will be returned.- Specified by:
asArray
in interfaceClaim
- Type Parameters:
T
- type- Parameters:
tClazz
- the type class- Returns:
- the value as an Array or null.
- Throws:
JWTDecodeException
- if the values inside the Array can't be converted to a class T.
-
asList
public <T> List<T> asList(Class<T> tClazz) throws JWTDecodeException
Description copied from interface:Claim
Get this Claim as a List of type T. If the value isn't an Array, null will be returned.- Specified by:
asList
in interfaceClaim
- Type Parameters:
T
- type- Parameters:
tClazz
- the type class- Returns:
- the value as a List or null.
- Throws:
JWTDecodeException
- if the values inside the List can't be converted to a class T.
-
asMap
public Map<String,Object> asMap() throws JWTDecodeException
Description copied from interface:Claim
Get this Claim as a generic Map of values.- Specified by:
asMap
in interfaceClaim
- Returns:
- the value as instance of Map.
- Throws:
JWTDecodeException
- if the value can't be converted to a Map.
-
as
public <T> T as(Class<T> tClazz) throws JWTDecodeException
Description copied from interface:Claim
Get this Claim as a custom type T.- Specified by:
as
in interfaceClaim
- Type Parameters:
T
- type- Parameters:
tClazz
- the type class- Returns:
- the value as instance of T.
- Throws:
JWTDecodeException
- if the value can't be converted to a class T.
-
-