Package nva.commons.core
Class Environment
- java.lang.Object
-
- nva.commons.core.Environment
-
public class Environment extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringENVIRONMENT_VARIABLE_NOT_SET
-
Constructor Summary
Constructors Constructor Description Environment()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringreadEnv(java.lang.String variableName)Read an Environment variable.java.util.Optional<java.lang.String>readEnvOpt(java.lang.String variableName)Read an Environment variable.
-
-
-
Field Detail
-
ENVIRONMENT_VARIABLE_NOT_SET
public static final java.lang.String ENVIRONMENT_VARIABLE_NOT_SET
- See Also:
- Constant Field Values
-
-
Method Detail
-
readEnvOpt
public java.util.Optional<java.lang.String> readEnvOpt(java.lang.String variableName)
Read an Environment variable.- Parameters:
variableName- the Env variable name.- Returns:
- the value of the variable or an empty Optional if the variable does not exists.
-
readEnv
public java.lang.String readEnv(java.lang.String variableName)
Read an Environment variable.- Parameters:
variableName- the Env variable name.- Returns:
- the value of the variable or throw if the variable does not exists.
-
-