Package io.pravega.common.util
Class EnvVars
- java.lang.Object
-
- io.pravega.common.util.EnvVars
-
public final class EnvVars extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intreadIntegerFromEnvVar(java.lang.String variableName, int defaultValue)Utility function to (statically) read a integer from from an environmental variable.
-
-
-
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.
-
-