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 Details

    • PRIORITY_COMPARATOR

      public static final Comparator<Class<? extends NodeFeature>> PRIORITY_COMPARATOR
      Comparator for finding the priority order between node feature types.
  • Method Details

    • 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 create
      node - the node for which the feature should be created
      Returns:
      a newly created feature
    • getId

      public static int getId(Class<? extends NodeFeature> nodeFeature)
      Gets the id of a node feature.
      Parameters:
      nodeFeature - the node feature
      Returns:
      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 type
      Returns:
      the node feature type