Class EnvVars


  • public final class EnvVars
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static int readIntegerFromEnvVar​(java.lang.String variableName, int defaultValue)
      Utility function to (statically) read a integer from from an environmental variable.
      • Methods inherited from class java.lang.Object

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

      • readIntegerFromEnvVar

        public static int readIntegerFromEnvVar​(java.lang.String variableName,
                                                int defaultValue)
        Utility function to (statically) read a integer from from an environmental variable. This is useful to initialize static constants that would be useful to change without recompilation, but which are not suitable to be made into config values. (IE because they are not intended to be public).
        Parameters:
        variableName - The name of the environmental variable to read.
        defaultValue - The default value to use if it is not set.
        Returns:
        The value parsed (of the default if none was set)
        Throws:
        java.lang.NumberFormatException - if the variable was set but could not be parsed as an integer.