public class JsonClaims extends JsonObjectWrapper
Constructor and Description |
---|
JsonClaims()
Creates a claim object on an empty JSON object.
|
JsonClaims(JsonObject jsonObject)
Creates a claim object on the given JSON object.
|
JsonClaims(JsonObjectAccessor jsonAccessor)
Creates a claim object on the given JSON object accessor.
|
Modifier and Type | Method and Description |
---|---|
static JsonClaims |
create()
Creates a claim object on an empty JSON object.
|
static JsonClaims |
create(JsonObject jsonObject)
Creates a claim object on the given JSON object.
|
static JsonClaims |
create(JsonObjectAccessor jsonAccessor)
Creates a claim object on the given JSON object accessor.
|
java.util.List<java.lang.String> |
getClaimNames()
Returns all claim names present in the underlying JSON object (maybe empty but never null).
|
<T> T |
getCustomField(IStringConstant name,
java.lang.Class<T> type)
Returns the value at the specified field name.
|
<T> T |
getCustomField(java.lang.String name,
java.lang.Class<T> type)
Returns the value at the specified field name.
|
JsonObjectAccessor |
getJsonAccessor()
Returns the underlying
JsonObjectAccessor ; |
JsonObject |
getJsonObject()
Returns the token part as
JsonObject . |
JsonObject |
getJsonObjectField(IStringConstant name)
Returns the JSON object at the specified field name.
|
JsonObject |
getJsonObjectField(java.lang.String name)
Returns the JSON object at the specified field name.
|
TimeValue |
getTimeValue(IStringConstant name,
TimeUnit timeUnit)
|
TimeValue |
getTimeValue(java.lang.String name,
TimeUnit timeUnit)
|
boolean |
isEmpty()
Returns true if this object contains no claim at all.
|
toString
public JsonClaims()
public JsonClaims(JsonObject jsonObject)
public JsonClaims(JsonObjectAccessor jsonAccessor)
public static JsonClaims create()
public static JsonClaims create(JsonObject jsonObject)
public static JsonClaims create(JsonObjectAccessor jsonAccessor)
public java.util.List<java.lang.String> getClaimNames()
public JsonObject getJsonObjectField(java.lang.String name)
name
- The name of the field (must not be null).public JsonObject getJsonObjectField(IStringConstant name)
name
- The name of the field (must not be null).public <T> T getCustomField(java.lang.String name, java.lang.Class<T> type)
name
- The name of the field (must not be null).type
- The expected return type (must not be null).public <T> T getCustomField(IStringConstant name, java.lang.Class<T> type)
name
- The name of the field (must not be null).type
- The expected return type (must not be null).public TimeValue getTimeValue(java.lang.String name, TimeUnit timeUnit)
name
- The name of the field (must not be null).timeUnit
- The time unit of the value found in the object (must not be null).public TimeValue getTimeValue(IStringConstant name, TimeUnit timeUnit)
name
- The name of the field (must not be null).timeUnit
- The time unit of the value found in the object (must not be null).public boolean isEmpty()
public JsonObject getJsonObject()
JsonObject
.getJsonObject
in class JsonObjectWrapper
public JsonObjectAccessor getJsonAccessor()
JsonObjectAccessor
;getJsonAccessor
in class JsonObjectWrapper