Class NodeFeature
java.lang.Object
com.vaadin.client.flow.nodefeature.NodeFeature
Holder of the actual data in a state node. The state node data is isolated
into different features of related data.
- Since:
- 1.0
- Author:
- Vaadin Ltd
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract elemental.json.JsonValueConvert the feature values into aJsonValueusing providedconverterfor the values stored in the feature (i.e. primitive types, StateNodes).protected elemental.json.JsonValuegetAsDebugJson(Object value) Helper for getting a JSON representation of a child value.abstract elemental.json.JsonValueGets a JSON object representing the contents of this feature.intgetId()Gets the id of this feature.getNode()Gets the node of this feature.
-
Constructor Details
-
NodeFeature
Creates a new feature.- Parameters:
id- the id of the featurenode- the node that the feature belongs to
-
-
Method Details
-
getId
public int getId()Gets the id of this feature.- Returns:
- the id
-
getNode
Gets the node of this feature.- Returns:
- the node
-
getDebugJson
public abstract elemental.json.JsonValue getDebugJson()Gets a JSON object representing the contents of this feature. Only intended for debugging purposes.- Returns:
- a JSON representation
-
convert
public abstract elemental.json.JsonValue convert(Function<Object, elemental.json.JsonValue> converter) Convert the feature values into aJsonValueusing providedconverterfor the values stored in the feature (i.e. primitive types, StateNodes).- Parameters:
converter- converter to convert values stored in the feature- Returns:
- resulting converted value
-
getAsDebugJson
Helper for getting a JSON representation of a child value.- Parameters:
value- the child value- Returns:
- the JSON representation
-