Package org.ametys.runtime.model
Class StaticEnumerator<T>
- java.lang.Object
-
- org.ametys.runtime.model.StaticEnumerator<T>
-
- Type Parameters:
T
- Type of the values
- All Implemented Interfaces:
Enumerator<T>
- Direct Known Subclasses:
MergePolicy.MergePolicyEnumerator
public class StaticEnumerator<T> extends Object implements Enumerator<T>
This implementation enumerate the static configured elements
-
-
Field Summary
Fields Modifier and Type Field Description private Map<T,I18nizableText>
_entries
-
Constructor Summary
Constructors Constructor Description StaticEnumerator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(I18nizableText label, T value)
Adds a new entry.I18nizableText
getEntry(T value)
Retrieves a single label from a value.Map<T,I18nizableText>
getTypedEntries()
Provides the enumerated values with their optional label.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.ametys.runtime.model.Enumerator
getConfiguration
-
-
-
-
Field Detail
-
_entries
private Map<T,I18nizableText> _entries
-
-
Constructor Detail
-
StaticEnumerator
public StaticEnumerator()
-
-
Method Detail
-
add
public void add(I18nizableText label, T value)
Adds a new entry.- Parameters:
label
- the entry label.value
- the entry value.
-
getEntry
public I18nizableText getEntry(T value)
Description copied from interface:Enumerator
Retrieves a single label from a value.- Specified by:
getEntry
in interfaceEnumerator<T>
- Parameters:
value
- the value.- Returns:
- the label or
null
if not found.
-
getTypedEntries
public Map<T,I18nizableText> getTypedEntries()
Description copied from interface:Enumerator
Provides the enumerated values with their optional label.- Specified by:
getTypedEntries
in interfaceEnumerator<T>
- Returns:
- the enumerated values and their label.
-
-