Package org.ametys.runtime.model
Class DefinitionAndValue<T>
- java.lang.Object
-
- org.ametys.runtime.model.DefinitionAndValue<T>
-
- Type Parameters:
T- Type of the root object
- Direct Known Subclasses:
CompositeDefinitionAndValue,ContentAttributeDefinitionAndValue,RepeaterDefinitionAndValue
public class DefinitionAndValue<T> extends Object
Pair of a value and its definition
-
-
Constructor Summary
Constructors Constructor Description DefinitionAndValue(T root, ModelItem definition, Object value)Creates a definition and value pairDefinitionAndValue(T root, ModelItem definition, Object value, DefinitionAndValue<T> parent)Creates a definition and value pair
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Map<String,Object>extractValues(Map<String,DefinitionAndValue> definitionAndValues)extract a map of values from a map of DefinitionAndValueModelItemgetDefinition()Retrieves the definitionDefinitionAndValue<T>getParent()Retrieves the parent of the definition and value pairTgetRoot()Retrieves the root object of this definition and value pairObjectgetValue()Retrieves the value
-
-
-
Constructor Detail
-
DefinitionAndValue
public DefinitionAndValue(T root, ModelItem definition, Object value)
Creates a definition and value pair- Parameters:
root- the root object of this definition and value pairdefinition- the definitionvalue- the value
-
DefinitionAndValue
public DefinitionAndValue(T root, ModelItem definition, Object value, DefinitionAndValue<T> parent)
Creates a definition and value pair- Parameters:
root- the root object of this definition and value pairdefinition- the definitionvalue- the valueparent- the parent of the definition and value pair
-
-
Method Detail
-
getRoot
public T getRoot()
Retrieves the root object of this definition and value pair- Returns:
- the root
-
getDefinition
public ModelItem getDefinition()
Retrieves the definition- Returns:
- the definition
-
getParent
public DefinitionAndValue<T> getParent()
Retrieves the parent of the definition and value pair- Returns:
- the parent
-
extractValues
public static Map<String,Object> extractValues(Map<String,DefinitionAndValue> definitionAndValues)
extract a map of values from a map of DefinitionAndValue- Parameters:
definitionAndValues- a map containing definition and values- Returns:
- a map containing only values
-
-