com.vaadin.flow.internal.nodefeature.
Class NodeFeatureRegistry
- java.lang.Object
-
- com.vaadin.flow.internal.nodefeature.NodeFeatureRegistry
-
public class NodeFeatureRegistry extends Object
A registry of node features that are available based on type.
For internal use only. May be renamed or removed in a future release.
Since:
1.0
Author:
Vaadin Ltd
-
-
Field Summary
Fields Modifier and Type Field Description static Comparator<Class<? extends NodeFeature>>
PRIORITY_COMPARATOR
Comparator for finding the priority order between node feature types.
-
Method Summary
All Methods Modifier and Type Method Description static NodeFeature
create(Class<? extends NodeFeature> nodeFeatureType, StateNode node)
Creates a feature of the given type for a node.
static Class<? extends NodeFeature>
getFeature(int featureId)
Finds the node feature type corresponding to the give node feature id.
static Collection<Class<? extends NodeFeature>>
getFeatures()
Gets all registered feature types.
static int
getId(Class<? extends NodeFeature> nodeFeature)
Gets the id of a node feature.
-
-
-
Field Detail
-
PRIORITY_COMPARATOR
public static final Comparator<Class<? extends NodeFeature>> PRIORITY_COMPARATOR
Comparator for finding the priority order between node feature types.
-
-
Method Detail
-
create
public static NodeFeature create(Class<? extends NodeFeature> nodeFeatureType, StateNode node)
Creates a feature of the given type for a node.
Parameters:
nodeFeatureType
- the type of the feature to createnode
- the node for which the feature should be createdReturns:
a newly created feature
-
getId
public static int getId(Class<? extends NodeFeature> nodeFeature)
Gets the id of a node feature.
Parameters:
nodeFeature
- the node featureReturns:
the id of the node feature
-
getFeatures
public static Collection<Class<? extends NodeFeature>> getFeatures()
Gets all registered feature types.
Returns:
an unmodifiable collection of feature types, not
null
-
getFeature
public static Class<? extends NodeFeature> getFeature(int featureId)
Finds the node feature type corresponding to the give node feature id.
Parameters:
featureId
- the feature id for which to get a node feature typeReturns:
the node feature type
-
-