Interface ConfigurationNodeFactory<N extends ConfigurationNode>

    • Method Detail

      • defaultOptions

        default ConfigurationOptions defaultOptions()
        Default options for the types of nodes created by this factory.

        All values must match what a created node will see, but some values may be determined by this factory to be non user-modifiable. These should be documented for any factory implementation.

        Returns:
        default options
        Since:
        4.0.0
      • createNode

        N createNode​(ConfigurationOptions options)
        Create an empty node with the provided options.

        Node options may be overridden if the factory enforces specific requirements on options.

        Parameters:
        options - node options
        Returns:
        newly created empty node
        Since:
        4.0.0
      • createNode

        default N createNode()
        Create a new node with default options.
        Returns:
        newly created empty node
        Since:
        4.0.0
      • createNode

        default <E extends ExceptionN createNode​(CheckedConsumer<N,​E> action)
                                            throws E extends Exception
        Create a new node with default options and initialize it with the provided action.
        Type Parameters:
        E - thrown type
        Parameters:
        action - action to initialize node with
        Returns:
        newly created empty node
        Throws:
        E - when thrown from inner action
        E extends Exception
        Since:
        4.0.0
      • createNode

        default <E extends ExceptionN createNode​(ConfigurationOptions options,
                                                   CheckedConsumer<N,​E> action)
                                            throws E extends Exception
        Create a new node with the provided options and initialize it with the provided action.

        Node options may be overridden if the factory enforces specific requirements on options.

        Type Parameters:
        E - thrown type
        Parameters:
        options - node options
        action - action to initialize node with
        Returns:
        newly created empty node
        Throws:
        E - when thrown from inner action
        E extends Exception
        Since:
        4.0.0
      • toMapCollector

        default <V> Collector<Map.Entry<?,​V>,​N,​NtoMapCollector​(TypeToken<V> valueType)
        Create a collector that appends values to a newly created node as map children.

        This collector does not accept values in parallel.

        Type Parameters:
        V - value type
        Parameters:
        valueType - marker for value type
        Returns:
        a new collector
        Since:
        4.0.0
      • toMapCollector

        default <V> Collector<Map.Entry<?,​V>,​N,​NtoMapCollector​(Class<V> valueType)
        Create a collector that appends values to a newly created node as map children.

        This collector does not accept values in parallel.

        Type Parameters:
        V - value type
        Parameters:
        valueType - marker for value type
        Returns:
        a new collector
        Since:
        4.0.0
      • toListCollector

        default <V> Collector<V,​N,​NtoListCollector​(TypeToken<V> valueType)
        Create a collector that appends values to a newly created node as list children.

        This collector does not accept values in parallel.

        Type Parameters:
        V - value type
        Parameters:
        valueType - marker for value type
        Returns:
        a new collector
        Since:
        4.0.0
      • toListCollector

        default <V> Collector<V,​N,​NtoListCollector​(Class<V> valueType)
        Create a collector that appends values to a newly created node as list children.

        This collector does not accept values in parallel.

        Type Parameters:
        V - value type
        Parameters:
        valueType - marker for value type
        Returns:
        a new collector
        Since:
        4.0.0