Package io.pravega.common.util
Class ConfigurationOptionsExtractor
- java.lang.Object
-
- io.pravega.common.util.ConfigurationOptionsExtractor
-
public class ConfigurationOptionsExtractor extends java.lang.ObjectA utility class for processing configuration items specified via system properties and/ environment variables.
-
-
Constructor Summary
Constructors Constructor Description ConfigurationOptionsExtractor()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.IntegerextractInt(@NonNull java.lang.String systemProperty, @NonNull java.lang.String environmentVariable, @NonNull java.lang.Integer defaultValue)Extracts a configuration value as integer from the specified from system property or environment variable.
-
-
-
Method Detail
-
extractInt
public static java.lang.Integer extractInt(@NonNull @NonNull java.lang.String systemProperty, @NonNull @NonNull java.lang.String environmentVariable, @NonNull @NonNull java.lang.Integer defaultValue)Extracts a configuration value as integer from the specified from system property or environment variable. If both are specified, the value from system property is returned. If neither are specified, it returns the {code defaultValue}. If the configuration value isn't an integer, it returns the default value.- Parameters:
systemProperty- the system property to extract the configuration value fromenvironmentVariable- the environment variable to extract the configuration value fromdefaultValue- the value to be returned if neithersystemPropertyorenvironmentVariableis specified- Returns:
- the specified or default configuration value
-
-