Class ClasspathConfigSource.Builder

    • Method Detail

      • build

        public ClasspathConfigSource build()
        Builds new instance of Classpath ConfigSource.

        If media-type not set it tries to guess it from resource extension before parsing.

        Specified by:
        build in interface Builder<ClasspathConfigSource>
        Returns:
        new instance of Classpath ConfigSource.
      • config

        public ClasspathConfigSource.Builder config​(Config metaConfig)
        Configure builder from meta configuration.

        The following configuration options are supported:

        Optional configuration parameters
        key default value description
        optional false Configure to true if this source should not fail configuration setup when underlying data is missing.
        polling-strategy No polling strategy is added by default Meta configuration of a polling strategy to be used with this source, add configuration to properties sub node.
        change-watcher No change watcher is added by default Meta configuration of a change watcher to be used with this source, add configuration to properties sub node.
        retry-policy No retry policy is added by default Meta configuration of a retry policy to be used to load this source, add configuration to properties sub node.
        Media type and type mapping
        media-type Media type from loaded data is used by default for parsable config sources Explicit media type to use, such as when a file has invalid suffix, or when we need to explicitly mark the media type.
        media-type-mapping No media type mapping is done by default A mapping of key to a media type, allowing us to have a key that contains a sub-tree (e.g. a key that contains json data) - when we configure a mapping of the key to application/json, the data would be expanded into config as a proper tree structure
        • resource - the classpath resource to load
        Overrides:
        config in class AbstractConfigSourceBuilder<ClasspathConfigSource.Builder,​Void>
        Parameters:
        metaConfig - configuration properties used to configure a builder instance.
        Returns:
        updated builder instance
      • resource

        public ClasspathConfigSource.Builder resource​(String resource)
        Configure the classpath resource to load the configuration from.
        Parameters:
        resource - resource on classpath
        Returns:
        updated builder instance