Class PrefixedConfigSource

    • Method Detail

      • create

        public static PrefixedConfigSource create​(Config metaConfig)
        Create a prefixed config source from meta configuration. The meta configuration must contain the configuration key "key" and meta configuration of another config source to be prefixed with the key.
        Parameters:
        metaConfig - meta configuration
        Returns:
        a new prefixed config source
      • create

        public static PrefixedConfigSource create​(String key,
                                                  ConfigSource source)
        Create a new prefixed config source.
        Parameters:
        key - prefix key
        source - wrapped source
        Returns:
        a new prefixed config source
      • description

        public String description()
        Description copied from interface: Source
        Short, human-readable summary referring to the underlying source.

        For example, a file path or a URL or any other information that helps the user recognize the underlying origin of the data this Source provides.

        Default is the implementation class simple name with any "Source" suffix removed.

        Specified by:
        description in interface Source
        Returns:
        description of the source
      • onChange

        public void onChange​(BiConsumer<String,​ConfigNode> changedNode)
        Description copied from interface: EventConfigSource
        Register a change listener.
        Specified by:
        onChange in interface EventConfigSource
        Parameters:
        changedNode - the key and node of the configuration that changed. This may be the whole config tree, or a specific node depending on how fine grained the detection mechanism is. To notify of a whole node being changed, use empty string as a key
      • exists

        public boolean exists()
        Description copied from interface: Source
        If the underlying data exist at this time. This is to prevent us loading such a source if we know it does not exist.
        Specified by:
        exists in interface Source
        Returns:
        true if the source exists, false otherwise
      • retryPolicy

        public Optional<RetryPolicy> retryPolicy()
        Description copied from interface: Source
        Retry policy configured on this config source.
        Specified by:
        retryPolicy in interface Source
        Returns:
        configured retry policy
      • optional

        public boolean optional()
        Description copied from interface: Source
        Whether this source is optional.
        Specified by:
        optional in interface Source
        Returns:
        return true for optional source, returns false by default