Class Environment


  • public final class Environment
    extends java.lang.Object
    Used to get a system property or environment variable.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String getValue​(java.lang.String key, java.lang.String defaultValue)
      Checks if the specified key is available in the system properties System.getProperty(String), environment variables System.getenv(String) or takes the default value.
      • Methods inherited from class java.lang.Object

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

      • getValue

        public static java.lang.String getValue​(java.lang.String key,
                                                java.lang.String defaultValue)
        Checks if the specified key is available in the system properties System.getProperty(String), environment variables System.getenv(String) or takes the default value. In this sequence.
        Parameters:
        key - Key or name of the property
        defaultValue - Value taken if nothing is available
        Returns:
        The value of the system property, variable or the default value