Class LazyNodeProvider<T extends ComparisonNode>


  • public class LazyNodeProvider<T extends ComparisonNode>
    extends Object
    Provides a comparison node while creating it by the first request. - the type of provided comparison node.
    • Constructor Detail

      • LazyNodeProvider

        public LazyNodeProvider​(T node)
        Creates a provider for the node that already exists.
        Parameters:
        node - the node to create the provider for, can be null
      • LazyNodeProvider

        public LazyNodeProvider​(Supplier<T> nodeFactory)
        Creates a provider with the specified factory for node creation.
        Parameters:
        nodeFactory - the factory to be called by first request to the node, cannot be null
    • Method Detail

      • getNode

        public T getNode()
        Creates if need and returns the node.
        Returns:
        the stored node, never null
      • isNodeCreated

        public boolean isNodeCreated()
        checks whether the node has been created by this lazy provider.
        Returns: