Package io.helidon.config
Class OverrideSources
- java.lang.Object
-
- io.helidon.config.OverrideSources
-
public final class OverrideSources extends Object
Class provides access to built-inOverrideSource
implementations.- See Also:
OverrideSource
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static AbstractOverrideSource.Builder<? extends AbstractOverrideSource.Builder<?,Path>,Path>
classpath(String resourceName)
Creates new instance of Classpath OverrideSource Builder to be used to bootstrap OverrideSource instance from specified resource.static OverrideSource
create(Map<String,String> overrideValues)
Creates a new instance odOverrideSource
from a map of wildcards to values.static OverrideSource
empty()
An empty implementation ofOverrideSource
.static AbstractOverrideSource.Builder<? extends AbstractOverrideSource.Builder<?,Path>,Path>
file(String file)
Creates new instance of the File OverrideSource Builder to be used to bootstrap an File OverrideSource instance.static AbstractOverrideSource.Builder<? extends AbstractOverrideSource.Builder<?,URL>,URL>
url(URL url)
Creates new instance of the URL OverrideSource Builder to be used to bootstrap an URL OverrideSource instance.
-
-
-
Method Detail
-
empty
public static OverrideSource empty()
An empty implementation ofOverrideSource
.A single instance is hold, so the return value is always the same.
- Returns:
- an empty implementation of
OverrideSource
-
create
public static OverrideSource create(Map<String,String> overrideValues)
Creates a new instance odOverrideSource
from a map of wildcards to values.Note that
Map
does not guarantee the ordering of the items, but overrides are resolved in specified order. When more than one of the overrides keys might match, the first of them will be applied.- Parameters:
overrideValues
- a map of wildcards to values- Returns:
- a new instance of
OverrideSource
-
classpath
public static AbstractOverrideSource.Builder<? extends AbstractOverrideSource.Builder<?,Path>,Path> classpath(String resourceName)
Creates new instance of Classpath OverrideSource Builder to be used to bootstrap OverrideSource instance from specified resource.The name of a resource is a '
/
'-separated full path name that identifies the resource. If the resource name has a leading slash then it is dropped before lookup.- Parameters:
resourceName
- a name of the resource- Returns:
- new Builder instance
-
file
public static AbstractOverrideSource.Builder<? extends AbstractOverrideSource.Builder<?,Path>,Path> file(String file)
Creates new instance of the File OverrideSource Builder to be used to bootstrap an File OverrideSource instance.- Parameters:
file
- a file with an override value map- Returns:
- an instance of builder
-
url
public static AbstractOverrideSource.Builder<? extends AbstractOverrideSource.Builder<?,URL>,URL> url(URL url)
Creates new instance of the URL OverrideSource Builder to be used to bootstrap an URL OverrideSource instance.- Parameters:
url
- an URL with an override value map- Returns:
- an instance of builder
-
-