Enum DefaultValueStructureAccessor
- java.lang.Object
-
- java.lang.Enum<DefaultValueStructureAccessor>
-
- de.xima.fc.workflow.processor.value.DefaultValueStructureAccessor
-
- All Implemented Interfaces:
IValueStructureAccessor,Serializable,Comparable<DefaultValueStructureAccessor>
public enum DefaultValueStructureAccessor extends Enum<DefaultValueStructureAccessor> implements IValueStructureAccessor
-
-
Enum Constant Summary
Enum Constants Enum Constant Description INSTANCEThe singleton instance of the default value structure accessor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectasPrimitive(Object value)If the value is a primitive, returns the unwrapped primitive value.booleanisList(Object value)Checks if the given value is a list of items.booleanisMap(Object value)Checks if the given value is a map of key-value pairs.booleanisPrimitive(Object value)Checks if the given value is a primitive value, i.e. not a container (list or map).ObjectlistGet(Object list, int index)If the value is a list, gets the item at the given index.intlistSize(Object value)If the value is a list, gets the number of items in the list.ObjectmapGet(Object map, Object key)If the value is a map, gets the value for the given key.Collection<?>mapKeys(Object map)If the value is a map, gets the keys of the map.static DefaultValueStructureAccessorvalueOf(String name)Returns the enum constant of this type with the specified name.static DefaultValueStructureAccessor[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
INSTANCE
public static final DefaultValueStructureAccessor INSTANCE
The singleton instance of the default value structure accessor.
-
-
Method Detail
-
values
public static DefaultValueStructureAccessor[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (DefaultValueStructureAccessor c : DefaultValueStructureAccessor.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static DefaultValueStructureAccessor valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
asPrimitive
public Object asPrimitive(Object value)
Description copied from interface:IValueStructureAccessorIf the value is a primitive, returns the unwrapped primitive value. E.g. for a boolean, should return aBoolean. Unspecified behavior if the value is not a primitive.- Specified by:
asPrimitivein interfaceIValueStructureAccessor- Parameters:
value- The primitive value to access.- Returns:
- The primitive value.
-
isList
public boolean isList(Object value)
Description copied from interface:IValueStructureAccessorChecks if the given value is a list of items.- Specified by:
isListin interfaceIValueStructureAccessor- Parameters:
value- The value to check.- Returns:
- True if the value is a list, false otherwise.
-
isMap
public boolean isMap(Object value)
Description copied from interface:IValueStructureAccessorChecks if the given value is a map of key-value pairs.- Specified by:
isMapin interfaceIValueStructureAccessor- Parameters:
value- The value to check.- Returns:
- True if the value is a map, false otherwise.
-
isPrimitive
public boolean isPrimitive(Object value)
Description copied from interface:IValueStructureAccessorChecks if the given value is a primitive value, i.e. not a container (list or map).- Specified by:
isPrimitivein interfaceIValueStructureAccessor- Parameters:
value- The value to check.- Returns:
- True if the value is a primitive, false otherwise.
-
listGet
public Object listGet(Object list, int index)
Description copied from interface:IValueStructureAccessorIf the value is a list, gets the item at the given index. Unspecified behavior if the value is not a list.- Specified by:
listGetin interfaceIValueStructureAccessor- Parameters:
list- The list with items to access.index- The index of the item to access.- Returns:
- The item at the given index.
-
listSize
public int listSize(Object value)
Description copied from interface:IValueStructureAccessorIf the value is a list, gets the number of items in the list. Unspecified behavior if the value is not a list.- Specified by:
listSizein interfaceIValueStructureAccessor- Parameters:
value- The list to get the size of.- Returns:
- The number of items in the list.
-
mapGet
public Object mapGet(Object map, Object key)
Description copied from interface:IValueStructureAccessorIf the value is a map, gets the value for the given key. Unspecified behavior if the value is not a map.- Specified by:
mapGetin interfaceIValueStructureAccessor- Parameters:
map- The map with key-value pairs to access.key- The key of the value to access.- Returns:
- The value for the given key, or null if the key does not exist in the map.
-
mapKeys
public Collection<?> mapKeys(Object map)
Description copied from interface:IValueStructureAccessorIf the value is a map, gets the keys of the map. Unspecified behavior if the value is not a map.- Specified by:
mapKeysin interfaceIValueStructureAccessor- Parameters:
map- The map with key-value pairs to access.- Returns:
- The keys of the map.
-
-