public class Dotenv
Dotenv
| Modifier and Type | Class and Description |
|---|---|
static class |
Dotenv.Instance
The dotenv instance
|
| Modifier and Type | Field and Description |
|---|---|
static Dotenv.Instance |
Instance
The dotenv instance
|
| Constructor and Description |
|---|
Dotenv()
Dotenv
|
| Modifier and Type | Method and Description |
|---|---|
static DotenvBuilder |
configure()
Configure dotenv
|
java.util.Set<io.github.cdimascio.dotenv.DotenvEntry> |
entries()
Returns all environment entries
|
java.util.Set<io.github.cdimascio.dotenv.DotenvEntry> |
entries(DotenvEntriesFilter filter)
Returns all environment entries filtered by {@link DotenvEntriesFilter}
|
java.lang.String |
get(java.lang.String envName)
Returns the value for the specified environment variable
|
java.lang.String |
get(java.lang.String envName,
java.lang.String defValue)
Returns the value for the environment variable, or the default value if absent
|
static Dotenv |
load()
Load the the contents of .env into the virtual environment.
Environment variables in the host environment override those in .env
|
public static Dotenv.Instance Instance
The dotenv instance
@Nullable
public java.lang.String get(@NotNull
java.lang.String envName)
Returns the value for the specified environment variable
envName - The environment variable name@NotNull public java.util.Set<io.github.cdimascio.dotenv.DotenvEntry> entries()
Returns all environment entries
@NotNull
public java.util.Set<io.github.cdimascio.dotenv.DotenvEntry> entries(@NotNull
DotenvEntriesFilter filter)
Returns all environment entries filtered by {@link DotenvEntriesFilter}
@NotNull
public java.lang.String get(@NotNull
java.lang.String envName,
@NotNull
java.lang.String defValue)
Returns the value for the environment variable, or the default value if absent
envName - The environment variable namedefValue - The default value@JvmStatic @NotNull public static DotenvBuilder configure()
Configure dotenv
@JvmStatic @NotNull public static Dotenv load()
Load the the contents of .env into the virtual environment. Environment variables in the host environment override those in .env