Package org.forgerock.json.jose.jwt
Class JWObject
- java.lang.Object
- 
- org.forgerock.json.jose.jwt.JWObject
 
- 
- Direct Known Subclasses:
- JWKSet,- JwtClaimsSet,- JwtHeader
 
 public abstract class JWObject extends Object A base implementation class for a JSON Web object.Provides a set of methods which are common across JWT, JWS, JWE and JWK implementations. - Since:
- 2.0.0
 
- 
- 
Constructor SummaryConstructors Constructor Description JWObject()Constructs a new, empty JWObject.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcheckListValuesAreOfType(List<?> value, Class<?> requiredClazz)Checks that the given List's type is of an assignable type from the required class.protected voidcheckValueIsOfType(Object value, Class<?> requiredClazz)Checks that the given value is of an assignable type from the required class.booleanequals(Object o)JsonValueget(String key)Returns the specified item value.inthashCode()booleanisDefined(String key)Returnstrueif this JWObject contains the specified item.protected booleanisValueOfType(Object value, Class<?> requiredClazz)Checks to see if the given value is of an assignable type from the required class.Set<String>keys()Returns the set of keys for this JWObject's values.voidput(String key, Object value)Sets or removes the value of the specified member.JsonValuetoJsonValue()Returns a json representation of the JWObject.StringtoString()Returns a string representation of the JWObject.
 
- 
- 
- 
Method Detail- 
checkValueIsOfTypeprotected void checkValueIsOfType(Object value, Class<?> requiredClazz) Checks that the given value is of an assignable type from the required class.Will throw a JwtRuntimeException if the value is not of the required type - Parameters:
- value- The value to check is of the required type.
- requiredClazz- The class of the required type.
- See Also:
- isValueOfType(Object, Class)
 
 - 
checkListValuesAreOfTypeprotected void checkListValuesAreOfType(List<?> value, Class<?> requiredClazz) Checks that the given List's type is of an assignable type from the required class.Will throw a JwtRuntimeException if the value is not of the required type - Parameters:
- value- The List to check the type is of the required type.
- requiredClazz- The class of the required type.
- See Also:
- checkValueIsOfType(Object, Class)
 
 - 
isValueOfTypeprotected boolean isValueOfType(Object value, Class<?> requiredClazz) Checks to see if the given value is of an assignable type from the required class.- Parameters:
- value- The value to check is of the required type.
- requiredClazz- The class of the required type.
- Returns:
- trueif the value if of the required type.
- See Also:
- checkValueIsOfType(Object, Class)
 
 - 
putpublic void put(String key, Object value) Sets or removes the value of the specified member.If the value is not null, then the value is set as the value of the given key. Otherwise, if the value is null and the key already exist with a value assigned to it, then the key and its value will be removed. If the specified key is not defined, calling this method has no effect. - Parameters:
- key- the- Mapkey identifying the value to set or to remove.
- value- the object value to assign to the member.
 
 - 
getpublic JsonValue get(String key) Returns the specified item value. If no such member value exists, then a JSON value containingnullis returned.- Parameters:
- key- the- Mapkey identifying the item to return.
- Returns:
- a JSON value containing the value or null.
 
 - 
isDefinedpublic boolean isDefined(String key) Returnstrueif this JWObject contains the specified item.- Parameters:
- key- the- Mapkey of the item to seek.
- Returns:
- trueif this JSON value contains the specified member.
 
 - 
keyspublic Set<String> keys() Returns the set of keys for this JWObject's values.The order of the resulting keys is undefined. If there are no values set, this method returns an empty set. - Returns:
- A Set of keys.
 
 - 
toStringpublic String toString() Returns a string representation of the JWObject. The result is guaranteed to be valid JSON object syntax.
 - 
toJsonValuepublic JsonValue toJsonValue() Returns a json representation of the JWObject.- Returns:
- A JSON representation.
 
 
- 
 
-