Package com.exedio.cope.pattern
Class EnumMapField<K extends Enum<K>,V>
java.lang.Object
com.exedio.cope.Feature
com.exedio.cope.Pattern
com.exedio.cope.pattern.EnumMapField<K,V>
- All Implemented Interfaces:
MapFieldInterface<K,
,V> Settable<EnumMap<K,
,V>> Serializable
public final class EnumMapField<K extends Enum<K>,V>
extends Pattern
implements Settable<EnumMap<K,V>>, MapFieldInterface<K,V>
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic <K extends Enum<K>,
V>
EnumMapField<K,V> create
(Class<K> keyClass, FunctionField<V> value) SetValue<?>[]
fallback()
fallbackTo
(K key) Returns value associated with given key for item.getAttribute
(K key) Deprecated.getFunctionWithFallback
(K key) Returns the exceptions possibly thrown, when setting a value for this settable.Returns the Key Class of this.Returns the map for given item.getMapWithFallback
(Item item) Returns the Value Class of this.getWithFallback
(Item item, K key) boolean
boolean
isFinal()
Returns true, if a value for the settable can be specified on the creation of an item only, thus cannot be modified later.boolean
Returns true, if a value for the settable should be specified on the creation of an item.boolean
static <K extends Enum<K>,
V>
EnumMapField<K,V> newMap
(Class<K> keyClass, FunctionField<V> value) Deprecated.Usecreate(Class,FunctionField)
insteadvoid
Sets value associated with given key for item.void
Sets the map for given item.Methods inherited from class com.exedio.cope.Pattern
addSource, addSource, addSource, addSource, addSourceFeature, addSourceFeature, addSourceFeature, annotationField, equals, getGeneratedTypes, getSourceFeatures, getSourceFeaturesGather, getSourceFields, getSources, getSourceTypes, getType, hashCode, initialize, newSourceType, newSourceType, newSourceType, newSourceType, newSourceType, newSourceType, newType, newType, onMount, registerSource
Methods inherited from class com.exedio.cope.Feature
afterModelCreated, getAbstractType, getAnnotation, getID, getLocalizationKeys, getName, getPattern, isAnnotationPresent, isSourceAlready, mount, readResolve, requireMounted, toString, toString, writeReplace
-
Method Details
-
create
public static <K extends Enum<K>,V> EnumMapField<K,V> create(Class<K> keyClass, FunctionField<V> value) -
fallbackTo
-
fallback
- See Also:
-
defaultTo
-
getKeyClass
Description copied from interface:MapFieldInterface
Returns the Key Class of this.- Specified by:
getKeyClass
in interfaceMapFieldInterface<K extends Enum<K>,
V>
-
getField
-
getValueTemplate
-
getValueClass
Description copied from interface:MapFieldInterface
Returns the Value Class of this.- Specified by:
getValueClass
in interfaceMapFieldInterface<K extends Enum<K>,
V>
-
get
Description copied from interface:MapFieldInterface
Returns value associated with given key for item. -
set
Description copied from interface:MapFieldInterface
Sets value associated with given key for item. -
getMap
Description copied from interface:MapFieldInterface
Returns the map for given item. -
setMap
Description copied from interface:MapFieldInterface
Sets the map for given item. -
execute
-
isFinal
public boolean isFinal()Description copied from interface:Settable
Returns true, if a value for the settable can be specified on the creation of an item only, thus cannot be modified later. -
isMandatory
public boolean isMandatory()- Specified by:
isMandatory
in interfaceSettable<K extends Enum<K>>
-
getInitialType
- Specified by:
getInitialType
in interfaceSettable<K extends Enum<K>>
-
isInitial
public boolean isInitial()Description copied from interface:Settable
Returns true, if a value for the settable should be specified on the creation of an item. -
getInitialExceptions
Description copied from interface:Settable
Returns the exceptions possibly thrown, when setting a value for this settable.- Specified by:
getInitialExceptions
in interfaceSettable<K extends Enum<K>>
-
hasFallbacks
public boolean hasFallbacks() -
getFallback
-
getWithFallback
-
getMapWithFallback
-
getFunctionWithFallback
-
newMap
@Deprecated public static <K extends Enum<K>,V> EnumMapField<K,V> newMap(Class<K> keyClass, FunctionField<V> value) Deprecated.Usecreate(Class,FunctionField)
instead -
getAttribute
Deprecated.renamed togetField(Enum)
.
-
getField(Enum)
.