Package io.github.cdimascio.dotenv
Interface Dotenv
-
public interface DotenvCreates and configures a new Dotenv instance
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classDotenv.FilterA dotenv entry filter
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static DotenvBuilderconfigure()Configures a newDotenvinstanceSet<DotenvEntry>entries()Returns the set of environment variables with valuesSet<DotenvEntry>entries(Dotenv.Filter filter)Returns the set ofDotenvEntrys matching the filterStringget(String key)Retrieves the value of the environment variable specified by keyStringget(String key, String defaultValue)Retrieves the value of the environment variable specified by key.static Dotenvload()Creates and loads aDotenvinstance with default options
-
-
-
Method Detail
-
configure
static DotenvBuilder configure()
Configures a newDotenvinstance- Returns:
- a new
Dotenvinstance
-
load
static Dotenv load()
Creates and loads aDotenvinstance with default options- Returns:
- a new
Dotenvinstance
-
entries
Set<DotenvEntry> entries()
Returns the set of environment variables with values- Returns:
- the set of
DotenvEntrys for all environment variables
-
entries
Set<DotenvEntry> entries(Dotenv.Filter filter)
Returns the set ofDotenvEntrys matching the filter- Parameters:
filter- the filter e.g.Dotenv.Filter- Returns:
- the set of
DotenvEntrys for environment variables matching theDotenv.Filter
-
get
String get(String key)
Retrieves the value of the environment variable specified by key- Parameters:
key- the environment variable- Returns:
- the value of the environment variable
-
get
String get(String key, String defaultValue)
Retrieves the value of the environment variable specified by key. If the key does not exist, then the default value is returned- Parameters:
key- the environment variabledefaultValue- the default value to return- Returns:
- the value of the environment variable or default value
-
-