public class EnvVariables extends Object
| Constructor and Description |
|---|
EnvVariables() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
getBoolean(String name)
Returns the value of the environmental variable with the given name as
boolean or throws an IllegalStateException if the variable
can not be found or an error occurs. |
static boolean |
getBoolean(String name,
boolean defaultValue)
Returns the value of the environmental variable with the given name as
boolean or the default value if the variable can not be found or an
error occurs. |
static boolean |
getBoolean(String name,
boolean defaultValue,
org.slf4j.Logger logger)
Returns the value of the environmental variable with the given name as
boolean or the default value if the variable can not be found or an
error occurs. |
static boolean |
getBoolean(String name,
org.slf4j.Logger logger)
Returns the value of the environmental variable with the given name as
boolean or throws an IllegalStateException if the variable
can not be found or an error occurs. |
static boolean |
getBoolean(String name,
Supplier<Boolean> defaultValueFactory)
Returns the value of the environmental variable with the given name as
boolean or the default value if the variable can not be found or an
error occurs. |
static boolean |
getBoolean(String name,
Supplier<Boolean> defaultValueFactory,
org.slf4j.Logger logger)
Returns the value of the environmental variable with the given name as
boolean or the default value if the variable can not be found or an
error occurs. |
protected static boolean |
getBooleanValue(String name,
boolean defaultValue,
org.slf4j.Logger logger,
boolean exceptionWhenFailing,
boolean hasDefaultValue)
Internal method defining the default value factory function before calling
getBooleanValue(String, Supplier, Logger, boolean). |
protected static boolean |
getBooleanValue(String name,
Supplier<Boolean> defaultValueFactory,
org.slf4j.Logger logger,
boolean exceptionWhenFailing)
Internal method defining the conversion function before calling
#getVariableValue(String, Function, Object, Logger). |
static int |
getInt(String name)
Returns the value of the environmental variable with the given name as
int or throws an IllegalStateException if the variable can
not be found or an error occurs. |
static int |
getInt(String name,
int defaultValue)
Returns the value of the environmental variable with the given name as
int or the default value if the variable can not be found or an error
occurs. |
static int |
getInt(String name,
int defaultValue,
org.slf4j.Logger logger)
Returns the value of the environmental variable with the given name as
int or the default value if the variable can not be found or an error
occurs. |
static int |
getInt(String name,
org.slf4j.Logger logger)
Returns the value of the environmental variable with the given name as
int or throws an IllegalStateException if the variable can
not be found or an error occurs. |
static int |
getInt(String name,
Supplier<Integer> defaultValueFactory)
Returns the value of the environmental variable with the given name as
int or the default value if the variable can not be found or an error
occurs. |
static int |
getInt(String name,
Supplier<Integer> defaultValueFactory,
org.slf4j.Logger logger)
Returns the value of the environmental variable with the given name as
int or the default value if the variable can not be found or an error
occurs. |
protected static int |
getIntValue(String name,
int defaultValue,
org.slf4j.Logger logger,
boolean exceptionWhenFailing,
boolean hasDefaultValue)
Internal method defining the default value factory function before calling
getIntValue(String, Supplier, Logger, boolean). |
protected static int |
getIntValue(String name,
Supplier<Integer> defaultValueFactory,
org.slf4j.Logger logger,
boolean exceptionWhenFailing)
Internal method defining the conversion function before calling
#getVariableValue(String, Function, Object, Logger). |
static long |
getLong(String name)
Returns the value of the environmental variable with the given name as
long or throws an IllegalStateException if the variable can
not be found or an error occurs. |
static long |
getLong(String name,
org.slf4j.Logger logger)
Returns the value of the environmental variable with the given name as
long or throws an IllegalStateException if the variable can
not be found or an error occurs. |
static long |
getLong(String name,
long defaultValue)
Returns the value of the environmental variable with the given name as
long or the default value if the variable can not be found or an error
occurs. |
static long |
getLong(String name,
long defaultValue,
org.slf4j.Logger logger)
Returns the value of the environmental variable with the given name as
long or the default value if the variable can not be found or an error
occurs. |
static long |
getLong(String name,
Supplier<Long> defaultValueFactory)
Returns the value of the environmental variable with the given name as
long or the default value if the variable can not be found or an error
occurs. |
static long |
getLong(String name,
Supplier<Long> defaultValueFactory,
org.slf4j.Logger logger)
Returns the value of the environmental variable with the given name as
long or the default value if the variable can not be found or an error
occurs. |
protected static long |
getLongValue(String name,
long defaultValue,
org.slf4j.Logger logger,
boolean exceptionWhenFailing,
boolean hasDefaultValue)
Internal method defining the default value factory function before calling
getLongValue(String, Supplier, Logger, boolean). |
protected static long |
getLongValue(String name,
Supplier<Long> defaultValueFactory,
org.slf4j.Logger logger,
boolean exceptionWhenFailing)
Internal method defining the conversion function before calling
#getVariableValue(String, Function, Object, Logger). |
static org.apache.jena.rdf.model.Model |
getModel(String name)
Returns the value of the environmental variable with the given name as
Model or throws an IllegalStateException if the variable can
not be found or an error occurs. |
static org.apache.jena.rdf.model.Model |
getModel(String name,
org.slf4j.Logger logger)
Returns the value of the environmental variable with the given name as
Model or throws an IllegalStateException if the variable can
not be found or an error occurs. |
static org.apache.jena.rdf.model.Model |
getModel(String name,
org.apache.jena.rdf.model.Model defaultValue)
Returns the value of the environmental variable with the given name as
Model or the default value if the variable can not be found or an
error occurs. |
static org.apache.jena.rdf.model.Model |
getModel(String name,
org.apache.jena.rdf.model.Model defaultValue,
org.slf4j.Logger logger)
Returns the value of the environmental variable with the given name as
Model or the default value if the variable can not be found or an
error occurs. |
static org.apache.jena.rdf.model.Model |
getModel(String name,
Supplier<org.apache.jena.rdf.model.Model> defaultValueFactory)
Returns the value of the environmental variable with the given name as
Model or the default value if the variable can not be found or an
error occurs. |
static org.apache.jena.rdf.model.Model |
getModel(String name,
Supplier<org.apache.jena.rdf.model.Model> defaultValueFactory,
org.slf4j.Logger logger)
Returns the value of the environmental variable with the given name as
Model or the default value if the variable can not be found or an
error occurs. |
protected static org.apache.jena.rdf.model.Model |
getModelValue(String name,
org.apache.jena.rdf.model.Model defaultValue,
org.slf4j.Logger logger,
boolean exceptionWhenFailing,
boolean hasDefaultValue)
Internal method defining the default value factory function before calling
getModelValue(String, Supplier, Logger, boolean). |
protected static org.apache.jena.rdf.model.Model |
getModelValue(String name,
Supplier<org.apache.jena.rdf.model.Model> defaultValueFactory,
org.slf4j.Logger logger,
boolean exceptionWhenFailing)
Internal method defining the conversion function before calling
#getVariableValue(String, Function, Object, Logger). |
static String |
getString(String name)
Returns the value of the environmental variable with the given name as
String or throws an IllegalStateException if the variable can
not be found or an error occurs. |
static String |
getString(String name,
org.slf4j.Logger logger)
Returns the value of the environmental variable with the given name as
String or throws an IllegalStateException if the variable can
not be found or an error occurs. |
static String |
getString(String name,
String defaultValue)
Returns the value of the environmental variable with the given name as
String or the default value if the variable can not be found or an
error occurs. |
static String |
getString(String name,
String defaultValue,
org.slf4j.Logger logger)
Returns the value of the environmental variable with the given name as
String or the default value if the variable can not be found or an
error occurs. |
static String |
getString(String name,
Supplier<String> defaultValueFactory)
Returns the value of the environmental variable with the given name as
String or the default value if the variable can not be found or an
error occurs. |
static String |
getString(String name,
Supplier<String> defaultValueFactory,
org.slf4j.Logger logger)
Returns the value of the environmental variable with the given name as
String or the default value if the variable can not be found or an
error occurs. |
protected static String |
getStringValue(String name,
String defaultValue,
org.slf4j.Logger logger,
boolean exceptionWhenFailing,
boolean hasDefaultValue)
Internal method defining the default value factory function before calling
getStringValue(String, Supplier, Logger, boolean). |
protected static String |
getStringValue(String name,
Supplier<String> defaultValueFactory,
org.slf4j.Logger logger,
boolean exceptionWhenFailing)
Internal method defining the conversion function before calling
#getVariableValue(String, Function, Object, Logger). |
protected static <T> T |
getVariableValue(String name,
Function<String,T> conversion,
Supplier<T> defaultValueFactory,
org.slf4j.Logger logger,
boolean exceptionWhenFailing)
Generic method for accessing an environmental variable which has the given
name and will be transformed into the return type using the given conversion
function.
|
protected static <T> T getVariableValue(String name, Function<String,T> conversion, Supplier<T> defaultValueFactory, org.slf4j.Logger logger, boolean exceptionWhenFailing) throws IllegalStateException
Logger objects. If a problem occurs and a Logger is
available, the error will be logged using the Logger.error(String)
method. If exceptionWhenFailing is set to true an
IllegalStateException is thrown. Else, if a defaultValueFactory is
available, a default value will be returned. Otherwise null is
returned.name - name of the environmental variable which should be accessedconversion - the function which is used to convert the String of the
variable value into the expected value type. It is assumed that
this function will throw an exception if an error occurs.defaultValueFactory - A factory method which can be used to generate a default value
which will be returned if the variable can not be found or if an
error occurs.logger - the Logger which will be used to log errors if they occur.exceptionWhenFailing - flag indicating whether an exception should be thrown if an error
occurs.IllegalStateException - if exceptionWhenFailing is set to true and one of the
following two errors occurs: 1) the variable is not available or
2) the conversion function throws an exception.public static String getString(String name) throws IllegalStateException
String or throws an IllegalStateException if the variable can
not be found or an error occurs.name - name of the environmental variable which should be accessedIllegalStateException - if the variable can not be found or an error occurs.public static String getString(String name, String defaultValue)
String or the default value if the variable can not be found or an
error occurs.name - name of the environmental variable which should be accesseddefaultValue - the default value which will be returned if the variable can not
be found or if an error occurs.public static String getString(String name, Supplier<String> defaultValueFactory)
String or the default value if the variable can not be found or an
error occurs.name - name of the environmental variable which should be accesseddefaultValueFactory - A factory method which can be used to generate a default value
which will be returned if the variable can not be found or if an
error occurs.logger - the Logger which will be used to log errors if they occur.public static String getString(String name, org.slf4j.Logger logger) throws IllegalStateException
String or throws an IllegalStateException if the variable can
not be found or an error occurs.name - name of the environmental variable which should be accessedlogger - the Logger which will be used to log errors if they occur.IllegalStateException - if the variable can not be found or an error occurs.public static String getString(String name, String defaultValue, org.slf4j.Logger logger)
String or the default value if the variable can not be found or an
error occurs.name - name of the environmental variable which should be accesseddefaultValue - the default value which will be returned if the variable can not
be found or if an error occurs.logger - the Logger which will be used to log errors if they occur.public static String getString(String name, Supplier<String> defaultValueFactory, org.slf4j.Logger logger)
String or the default value if the variable can not be found or an
error occurs.name - name of the environmental variable which should be accesseddefaultValueFactory - A factory method which can be used to generate a default value
which will be returned if the variable can not be found or if an
error occurs.logger - the Logger which will be used to log errors if they occur.protected static String getStringValue(String name, String defaultValue, org.slf4j.Logger logger, boolean exceptionWhenFailing, boolean hasDefaultValue) throws IllegalStateException
getStringValue(String, Supplier, Logger, boolean).name - name of the environmental variable which should be accessedconversion - the function which is used to convert the String of the
variable value into the expected value type. It is assumed that
this function will throw an exception if an error occurs.defaultValue - the default value which will be returned if the variable can not
be found or if an error occurs.logger - the Logger which will be used to log errors if they occur.exceptionWhenFailing - flag indicating whether an exception should be thrown if an error
occurs.hasDefaultValue - flag indicating whether a default value has been provided.IllegalStateException - if exceptionWhenFailing is set to true and one of the
following two errors occurs: 1) the variable is not available or
2) the conversion function throws an exception.protected static String getStringValue(String name, Supplier<String> defaultValueFactory, org.slf4j.Logger logger, boolean exceptionWhenFailing) throws IllegalStateException
#getVariableValue(String, Function, Object, Logger).name - name of the environmental variable which should be accessedconversion - the function which is used to convert the String of the
variable value into the expected value type. It is assumed that
this function will throw an exception if an error occurs.defaultValueFactory - A factory method which can be used to generate a default value
which will be returned if the variable can not be found or if an
error occurs.logger - the Logger which will be used to log errors if they occur.exceptionWhenFailing - flag indicating whether an exception should be thrown if an error
occurs.IllegalStateException - if exceptionWhenFailing is set to true and one of the
following two errors occurs: 1) the variable is not available or
2) the conversion function throws an exception.public static org.apache.jena.rdf.model.Model getModel(String name) throws IllegalStateException
Model or throws an IllegalStateException if the variable can
not be found or an error occurs.name - name of the environmental variable which should be accessedIllegalStateException - if the variable can not be found or an error occurs.public static org.apache.jena.rdf.model.Model getModel(String name, org.apache.jena.rdf.model.Model defaultValue)
Model or the default value if the variable can not be found or an
error occurs.name - name of the environmental variable which should be accesseddefaultValue - the default value which will be returned if the variable can not
be found or if an error occurs.public static org.apache.jena.rdf.model.Model getModel(String name, Supplier<org.apache.jena.rdf.model.Model> defaultValueFactory)
Model or the default value if the variable can not be found or an
error occurs.name - name of the environmental variable which should be accesseddefaultValueFactory - A factory method which can be used to generate a default value
which will be returned if the variable can not be found or if an
error occurs.public static org.apache.jena.rdf.model.Model getModel(String name, org.slf4j.Logger logger) throws IllegalStateException
Model or throws an IllegalStateException if the variable can
not be found or an error occurs.name - name of the environmental variable which should be accessedlogger - the Logger which will be used to log errors if they occur.IllegalStateException - if the variable can not be found or an error occurs.public static org.apache.jena.rdf.model.Model getModel(String name, org.apache.jena.rdf.model.Model defaultValue, org.slf4j.Logger logger)
Model or the default value if the variable can not be found or an
error occurs.name - name of the environmental variable which should be accesseddefaultValue - the default value which will be returned if the variable can not
be found or if an error occurs.logger - the Logger which will be used to log errors if they occur.public static org.apache.jena.rdf.model.Model getModel(String name, Supplier<org.apache.jena.rdf.model.Model> defaultValueFactory, org.slf4j.Logger logger)
Model or the default value if the variable can not be found or an
error occurs.name - name of the environmental variable which should be accesseddefaultValueFactory - A factory method which can be used to generate a default value
which will be returned if the variable can not be found or if an
error occurs.logger - the Logger which will be used to log errors if they occur.protected static org.apache.jena.rdf.model.Model getModelValue(String name, org.apache.jena.rdf.model.Model defaultValue, org.slf4j.Logger logger, boolean exceptionWhenFailing, boolean hasDefaultValue) throws IllegalStateException
getModelValue(String, Supplier, Logger, boolean).name - name of the environmental variable which should be accessedconversion - the function which is used to convert the String of the
variable value into the expected value type. It is assumed that
this function will throw an exception if an error occurs.defaultValue - the default value which will be returned if the variable can not
be found or if an error occurs.logger - the Logger which will be used to log errors if they occur.exceptionWhenFailing - flag indicating whether an exception should be thrown if an error
occurs.hasDefaultValue - flag indicating whether a default value has been provided.IllegalStateException - if exceptionWhenFailing is set to true and one of the
following two errors occurs: 1) the variable is not available or
2) the conversion function throws an exception.protected static org.apache.jena.rdf.model.Model getModelValue(String name, Supplier<org.apache.jena.rdf.model.Model> defaultValueFactory, org.slf4j.Logger logger, boolean exceptionWhenFailing) throws IllegalStateException
#getVariableValue(String, Function, Object, Logger).name - name of the environmental variable which should be accessedconversion - the function which is used to convert the String of the
variable value into the expected value type. It is assumed that
this function will throw an exception if an error occurs.defaultValueFactory - A factory method which can be used to generate a default value
which will be returned if the variable can not be found or if an
error occurs.logger - the Logger which will be used to log errors if they occur.exceptionWhenFailing - flag indicating whether an exception should be thrown if an error
occurs.IllegalStateException - if exceptionWhenFailing is set to true and one of the
following two errors occurs: 1) the variable is not available or
2) the conversion function throws an exception.public static int getInt(String name) throws IllegalStateException
int or throws an IllegalStateException if the variable can
not be found or an error occurs.name - name of the environmental variable which should be accessedIllegalStateException - if the variable can not be found or an error occurs.public static int getInt(String name, int defaultValue)
int or the default value if the variable can not be found or an error
occurs.name - name of the environmental variable which should be accesseddefaultValue - the default value which will be returned if the variable can not
be found or if an error occurs.public static int getInt(String name, Supplier<Integer> defaultValueFactory)
int or the default value if the variable can not be found or an error
occurs.name - name of the environmental variable which should be accesseddefaultValueFactory - A factory method which can be used to generate a default value
which will be returned if the variable can not be found or if an
error occurs.public static int getInt(String name, org.slf4j.Logger logger) throws IllegalStateException
int or throws an IllegalStateException if the variable can
not be found or an error occurs.name - name of the environmental variable which should be accessedlogger - the Logger which will be used to log errors if they occur.IllegalStateException - if the variable can not be found or an error occurs.public static int getInt(String name, int defaultValue, org.slf4j.Logger logger)
int or the default value if the variable can not be found or an error
occurs.name - name of the environmental variable which should be accesseddefaultValue - the default value which will be returned if the variable can not
be found or if an error occurs.logger - the Logger which will be used to log errors if they occur.public static int getInt(String name, Supplier<Integer> defaultValueFactory, org.slf4j.Logger logger)
int or the default value if the variable can not be found or an error
occurs.name - name of the environmental variable which should be accesseddefaultValueFactory - A factory method which can be used to generate a default value
which will be returned if the variable can not be found or if an
error occurs.logger - the Logger which will be used to log errors if they occur.protected static int getIntValue(String name, int defaultValue, org.slf4j.Logger logger, boolean exceptionWhenFailing, boolean hasDefaultValue) throws IllegalStateException
getIntValue(String, Supplier, Logger, boolean).name - name of the environmental variable which should be accessedconversion - the function which is used to convert the String of the
variable value into the expected value type. It is assumed that
this function will throw an exception if an error occurs.defaultValue - the default value which will be returned if the variable can not
be found or if an error occurs.logger - the Logger which will be used to log errors if they occur.exceptionWhenFailing - flag indicating whether an exception should be thrown if an error
occurs.hasDefaultValue - flag indicating whether a default value has been provided.IllegalStateException - if exceptionWhenFailing is set to true and one of the
following two errors occurs: 1) the variable is not available or
2) the conversion function throws an exception.protected static int getIntValue(String name, Supplier<Integer> defaultValueFactory, org.slf4j.Logger logger, boolean exceptionWhenFailing) throws IllegalStateException
#getVariableValue(String, Function, Object, Logger).name - name of the environmental variable which should be accessedconversion - the function which is used to convert the String of the
variable value into the expected value type. It is assumed that
this function will throw an exception if an error occurs.defaultValueFactory - A factory method which can be used to generate a default value
which will be returned if the variable can not be found or if an
error occurs.logger - the Logger which will be used to log errors if they occur.exceptionWhenFailing - flag indicating whether an exception should be thrown if an error
occurs.IllegalStateException - if exceptionWhenFailing is set to true and one of the
following two errors occurs: 1) the variable is not available or
2) the conversion function throws an exception.public static long getLong(String name) throws IllegalStateException
long or throws an IllegalStateException if the variable can
not be found or an error occurs.name - name of the environmental variable which should be accessedIllegalStateException - if the variable can not be found or an error occurs.public static long getLong(String name, long defaultValue)
long or the default value if the variable can not be found or an error
occurs.name - name of the environmental variable which should be accesseddefaultValue - the default value which will be returned if the variable can not
be found or if an error occurs.public static long getLong(String name, Supplier<Long> defaultValueFactory)
long or the default value if the variable can not be found or an error
occurs.name - name of the environmental variable which should be accesseddefaultValueFactory - A factory method which can be used to generate a default value
which will be returned if the variable can not be found or if an
error occurs.public static long getLong(String name, org.slf4j.Logger logger) throws IllegalStateException
long or throws an IllegalStateException if the variable can
not be found or an error occurs.name - name of the environmental variable which should be accessedlogger - the Logger which will be used to log errors if they occur.IllegalStateException - if the variable can not be found or an error occurs.public static long getLong(String name, long defaultValue, org.slf4j.Logger logger)
long or the default value if the variable can not be found or an error
occurs.name - name of the environmental variable which should be accesseddefaultValue - the default value which will be returned if the variable can not
be found or if an error occurs.logger - the Logger which will be used to log errors if they occur.public static long getLong(String name, Supplier<Long> defaultValueFactory, org.slf4j.Logger logger)
long or the default value if the variable can not be found or an error
occurs.name - name of the environmental variable which should be accesseddefaultValueFactory - A factory method which can be used to generate a default value
which will be returned if the variable can not be found or if an
error occurs.logger - the Logger which will be used to log errors if they occur.protected static long getLongValue(String name, long defaultValue, org.slf4j.Logger logger, boolean exceptionWhenFailing, boolean hasDefaultValue) throws IllegalStateException
getLongValue(String, Supplier, Logger, boolean).name - name of the environmental variable which should be accessedconversion - the function which is used to convert the String of the
variable value into the expected value type. It is assumed that
this function will throw an exception if an error occurs.defaultValue - the default value which will be returned if the variable can not
be found or if an error occurs.logger - the Logger which will be used to log errors if they occur.exceptionWhenFailing - flag indicating whether an exception should be thrown if an error
occurs.hasDefaultValue - flag indicating whether a default value has been provided.IllegalStateException - if exceptionWhenFailing is set to true and one of the
following two errors occurs: 1) the variable is not available or
2) the conversion function throws an exception.protected static long getLongValue(String name, Supplier<Long> defaultValueFactory, org.slf4j.Logger logger, boolean exceptionWhenFailing) throws IllegalStateException
#getVariableValue(String, Function, Object, Logger).name - name of the environmental variable which should be accessedconversion - the function which is used to convert the String of the
variable value into the expected value type. It is assumed that
this function will throw an exception if an error occurs.defaultValueFactory - A factory method which can be used to generate a default value
which will be returned if the variable can not be found or if an
error occurs.logger - the Logger which will be used to log errors if they occur.exceptionWhenFailing - flag indicating whether an exception should be thrown if an error
occurs.IllegalStateException - if exceptionWhenFailing is set to true and one of the
following two errors occurs: 1) the variable is not available or
2) the conversion function throws an exception.public static boolean getBoolean(String name) throws IllegalStateException
boolean or throws an IllegalStateException if the variable
can not be found or an error occurs.name - name of the environmental variable which should be accessedIllegalStateException - if the variable can not be found or an error occurs.public static boolean getBoolean(String name, boolean defaultValue)
boolean or the default value if the variable can not be found or an
error occurs.name - name of the environmental variable which should be accesseddefaultValue - the default value which will be returned if the variable can not
be found or if an error occurs.public static boolean getBoolean(String name, Supplier<Boolean> defaultValueFactory)
boolean or the default value if the variable can not be found or an
error occurs.name - name of the environmental variable which should be accesseddefaultValueFactory - A factory method which can be used to generate a default value
which will be returned if the variable can not be found or if an
error occurs.public static boolean getBoolean(String name, org.slf4j.Logger logger) throws IllegalStateException
boolean or throws an IllegalStateException if the variable
can not be found or an error occurs.name - name of the environmental variable which should be accessedlogger - the Logger which will be used to log errors if they occur.IllegalStateException - if the variable can not be found or an error occurs.public static boolean getBoolean(String name, boolean defaultValue, org.slf4j.Logger logger)
boolean or the default value if the variable can not be found or an
error occurs.name - name of the environmental variable which should be accesseddefaultValue - the default value which will be returned if the variable can not
be found or if an error occurs.logger - the Logger which will be used to log errors if they occur.public static boolean getBoolean(String name, Supplier<Boolean> defaultValueFactory, org.slf4j.Logger logger)
boolean or the default value if the variable can not be found or an
error occurs.name - name of the environmental variable which should be accesseddefaultValueFactory - A factory method which can be used to generate a default value
which will be returned if the variable can not be found or if an
error occurs.logger - the Logger which will be used to log errors if they occur.protected static boolean getBooleanValue(String name, boolean defaultValue, org.slf4j.Logger logger, boolean exceptionWhenFailing, boolean hasDefaultValue) throws IllegalStateException
getBooleanValue(String, Supplier, Logger, boolean).name - name of the environmental variable which should be accessedconversion - the function which is used to convert the String of the
variable value into the expected value type. It is assumed that
this function will throw an exception if an error occurs.defaultValue - the default value which will be returned if the variable can not
be found or if an error occurs.logger - the Logger which will be used to log errors if they occur.exceptionWhenFailing - flag indicating whether an exception should be thrown if an error
occurs.hasDefaultValue - flag indicating whether a default value has been provided.IllegalStateException - if exceptionWhenFailing is set to true and one of the
following two errors occurs: 1) the variable is not available or
2) the conversion function throws an exception.protected static boolean getBooleanValue(String name, Supplier<Boolean> defaultValueFactory, org.slf4j.Logger logger, boolean exceptionWhenFailing) throws IllegalStateException
#getVariableValue(String, Function, Object, Logger).name - name of the environmental variable which should be accessedconversion - the function which is used to convert the String of the
variable value into the expected value type. It is assumed that
this function will throw an exception if an error occurs.defaultValueFactory - A factory method which can be used to generate a default value
which will be returned if the variable can not be found or if an
error occurs.logger - the Logger which will be used to log errors if they occur.exceptionWhenFailing - flag indicating whether an exception should be thrown if an error
occurs.IllegalStateException - if exceptionWhenFailing is set to true and one of the
following two errors occurs: 1) the variable is not available or
2) the conversion function throws an exception.Copyright © 2017–2020. All rights reserved.