Package org.forgerock.am.cts.api.fields
Class CoreTokenFieldTypes
- java.lang.Object
-
- org.forgerock.am.cts.api.fields.CoreTokenFieldTypes
-
public class CoreTokenFieldTypes extends Object
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 Constructor Description CoreTokenFieldTypes()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
isByteArray(CoreTokenField field)
static boolean
isCalendar(CoreTokenField field)
static boolean
isInteger(CoreTokenField field)
static boolean
isMulti(CoreTokenField field)
static boolean
isString(CoreTokenField field)
static void
validateType(CoreTokenField field, Object value)
Validate the value matches the expected type for the given key.static void
validateTypes(Map<CoreTokenField,Object> types)
Validate a collection of key/value mappings.
-
-
-
Method Detail
-
validateTypes
public static void validateTypes(Map<CoreTokenField,Object> types) throws CoreTokenException
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
public static void validateType(CoreTokenField field, Object value) throws CoreTokenException
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
public static boolean isCalendar(CoreTokenField field)
- Parameters:
field
- Non null field to check.- Returns:
- True if the field is a Date.
-
isInteger
public static boolean isInteger(CoreTokenField field)
- Parameters:
field
- Non null field to check.- Returns:
- True if the field is an Integer.
-
isString
public static boolean isString(CoreTokenField field)
- Parameters:
field
- Non null field to check.- Returns:
- True if the field is a String.
-
isMulti
public static boolean isMulti(CoreTokenField field)
- Parameters:
field
- Non null field to check.- Returns:
- True if the field is a multi-value field.
-
isByteArray
public static boolean isByteArray(CoreTokenField field)
- Parameters:
field
- Non null field to check.- Returns:
- True if the field is a binary field.
-
-