Configuration.<T>get Method

Definition

Overloads

<T>get(String name, T defaultValue)

Gets the value of the configuration converted to T.

This method first checks the values previously loaded from the environment, if the configuration is found there it will be returned. Otherwise, this will attempt to load the value from the environment.

If no configuration is found, the defaultValue is returned.

<T>get(String name, Function<String,T> converter)

Gets the value of the configuration and converts it with the converter.

This method first checks the values previously loaded from the environment, if the configuration is found there it will be returned. Otherwise, this will attempt to load the value from the environment.

If no configuration is found the converter won't be called and null will be returned.

get(String name)

Gets the value of the configuration.

This method first checks the values previously loaded from the environment, if the configuration is found there it will be returned. Otherwise, this will attempt to load the value from the environment.

<T>get(String name, T defaultValue)

Gets the value of the configuration converted to T.

This method first checks the values previously loaded from the environment, if the configuration is found there it will be returned. Otherwise, this will attempt to load the value from the environment.

If no configuration is found, the defaultValue is returned.

public T <T>get(String name, T defaultValue)

Parameters

name
java.lang.String

Name of the configuration.

defaultValue
T

Value to return if the configuration isn't found.

Returns

T

The converted configuration if found, otherwise the default value is returned.

<T>get(String name, Function<String,T> converter)

Gets the value of the configuration and converts it with the converter.

This method first checks the values previously loaded from the environment, if the configuration is found there it will be returned. Otherwise, this will attempt to load the value from the environment.

If no configuration is found the converter won't be called and null will be returned.

public T <T>get(String name, Function<String,T> converter)

Parameters

name
java.lang.String

Name of the configuration.

converter
java.util.function.Function<java.lang.String,T>

Converter used to map the configuration to T.

Returns

T

The converted configuration if found, otherwise null.

get(String name)

Gets the value of the configuration.

This method first checks the values previously loaded from the environment, if the configuration is found there it will be returned. Otherwise, this will attempt to load the value from the environment.

public String get(String name)

Parameters

name
java.lang.String

Name of the configuration.

Returns

java.lang.String

Value of the configuration if found, otherwise null.

Applies to