Class ConfigurationOptions


  • @CheckReturnValue
    public abstract class ConfigurationOptions
    extends Object
    This object is a holder for general configuration options.

    This is meant to hold options that are used in configuring how the configuration data structures are handled, rather than the serialization configuration which is located in ConfigurationLoaders.

    This class is immutable.

    Since:
    4.0.0
    • Method Detail

      • defaults

        public static ConfigurationOptions defaults()
        Get the default set of options. This may be overridden by your chosen configuration loader, so when building configurations it is recommended to access AbstractConfigurationLoader.Builder#getDefaultOptions() instead.
        Returns:
        the default options
        Since:
        4.0.0
      • header

        public abstract @Nullable String header()
        Gets the header specified in these options.
        Returns:
        the current header. Lines are split by \n, with no trailing newline
        Since:
        4.0.0
      • acceptsType

        public final boolean acceptsType​(Class<?> type)
        Gets whether objects of the provided type are natively accepted as values for nodes with this as their options object.
        Parameters:
        type - the type to check
        Returns:
        whether the type is accepted
        Since:
        4.0.0
      • shouldCopyDefaults

        public abstract boolean shouldCopyDefaults()
        Gets whether or not default parameters provided to ConfigurationNode getter methods should be set to the node when used.
        Returns:
        whether defaults should be copied into value
        Since:
        4.0.0
      • implicitInitialization

        public abstract boolean implicitInitialization()
        Get whether values should be implicitly initialized.

        When this is true, any value get operations will return an empty value rather than null. This extends through to fields loaded into object-mapped classes.

        This option is enabled by default.

        Returns:
        if implicit initialization is enabled.
        Since:
        4.0.0