public class EnvironmentOptions extends Object
Constructor and Description |
---|
EnvironmentOptions()
Creates environment options.
|
Modifier and Type | Method and Description |
---|---|
List<String> |
getActiveNames()
Active environment names or fallback and read them from system property:
application.env . |
String |
getBasedir()
Base directory to use or
null for default. |
ClassLoader |
getClassLoader()
Class loader.
|
ClassLoader |
getClassLoader(ClassLoader defaultClassLoader)
Class loader.
|
String |
getFilename()
Configuration file name.
|
EnvironmentOptions |
setActiveNames(List<String> activeNames)
Set active environment names.
|
EnvironmentOptions |
setActiveNames(String... activeNames)
Set active environment names.
|
EnvironmentOptions |
setBasedir(Path basedir)
Set base dir.
|
EnvironmentOptions |
setBasedir(String basedir)
Set base dir.
|
EnvironmentOptions |
setClassLoader(ClassLoader classLoader)
Set class loader.
|
EnvironmentOptions |
setFilename(String filename)
Set file name.
|
public EnvironmentOptions()
application.conf
.public List<String> getActiveNames()
application.env
.@Nonnull public EnvironmentOptions setActiveNames(@Nonnull String... activeNames)
activeNames
- Active environment names.@Nonnull public EnvironmentOptions setActiveNames(@Nonnull List<String> activeNames)
activeNames
- Active environment names.@Nonnull public ClassLoader getClassLoader()
@Nonnull public ClassLoader getClassLoader(@Nonnull ClassLoader defaultClassLoader)
defaultClassLoader
- Default classloader is none was set.@Nonnull public EnvironmentOptions setClassLoader(@Nonnull ClassLoader classLoader)
classLoader
- Class loader.@Nullable public String getBasedir()
null
for default.null
for default.s@Nonnull public String getFilename()
@Nonnull public EnvironmentOptions setBasedir(@Nullable String basedir)
basedir
- Base dir. Classpath folder or file system directory.@Nonnull public EnvironmentOptions setBasedir(@Nullable Path basedir)
basedir
- Base dir.@Nonnull public EnvironmentOptions setFilename(@Nonnull String filename)
filename
- File name with extension. Supported extensions are: .properties
,
.conf
and .json
.Copyright © 2022. All rights reserved.