Class Environment


  • public class Environment
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      Environment()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String readEnv​(java.lang.String variableName)
      Read an Environment variable.
      java.util.Optional<java.lang.String> readEnvOpt​(java.lang.String variableName)
      Read an Environment variable.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • ENVIRONMENT_VARIABLE_NOT_SET

        public static final java.lang.String ENVIRONMENT_VARIABLE_NOT_SET
        See Also:
        Constant Field Values
    • Constructor Detail

      • Environment

        public Environment()
    • 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.