Package org.forgerock.am.cts.api.fields
Class CoreTokenFieldTypes
java.lang.Object
org.forgerock.am.cts.api.fields.CoreTokenFieldTypes
Provides the mapping between CoreTokenFields and the type of the value that is associated to
that field.
There are currently a number of uses for the type information of a Core Token Field:
- Manipulating a Token via its generic fields.
- Persisting a Token to LDAP
Both of these cases need to know the type of the value stored in the Tokens map.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisByteArray(CoreTokenField field) static booleanisCalendar(CoreTokenField field) static booleanisInteger(CoreTokenField field) static booleanisMulti(CoreTokenField field) static booleanisString(CoreTokenField field) static voidvalidateType(CoreTokenField field, Object value) Validate the value matches the expected type for the given key.static voidvalidateTypes(Map<CoreTokenField, Object> types) Validate a collection of key/value mappings.
-
Constructor Details
-
CoreTokenFieldTypes
public CoreTokenFieldTypes()
-
-
Method Details
-
validateTypes
Validate a collection of key/value mappings.- Parameters:
types- A mapping of CoreTokenField to value. Non null, may be empty.- Throws:
CoreTokenException- If one of the values was invalid for the CoreTokenField field.
-
validateType
Validate the value matches the expected type for the given key.- Parameters:
field- The CoreTokenField to validate against.value- The value to verify. Non null.- Throws:
CoreTokenException
-
isCalendar
- Parameters:
field- Non null field to check.- Returns:
- True if the field is a Date.
-
isInteger
- Parameters:
field- Non null field to check.- Returns:
- True if the field is an Integer.
-
isString
- Parameters:
field- Non null field to check.- Returns:
- True if the field is a String.
-
isMulti
- Parameters:
field- Non null field to check.- Returns:
- True if the field is a multi-value field.
-
isByteArray
- Parameters:
field- Non null field to check.- Returns:
- True if the field is a binary field.
-