Interface ConfigurationNodeFactory<N extends ConfigurationNode>

All Known Subinterfaces:
ConfigurationLoader<N>
All Known Implementing Classes:
AbstractConfigurationLoader, GsonConfigurationLoader, HoconConfigurationLoader, JacksonConfigurationLoader, XmlConfigurationLoader, YamlConfigurationLoader
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

Something that can create a customized node.
Since:
4.0.0
  • Method Details

    • 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

      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 Exception> N createNode(CheckedConsumer<N,E> action) throws E
      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
      Since:
      4.0.0
    • createNode

      default <E extends Exception> N createNode(ConfigurationOptions options, CheckedConsumer<N,E> action) throws E
      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
      Since:
      4.0.0
    • toMapCollector

      default <V> Collector<Map.Entry<?,V>,N,N> toMapCollector(io.leangen.geantyref.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,N> toMapCollector(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,N> toListCollector(io.leangen.geantyref.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,N> toListCollector(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