systemSettingOrNull

fun <T : Any> systemSettingOrNull(type: KClass<T>, name: String): T?

Retrieve a setting by name by looking in OS environment variables first and in the JVM system properties if not found.

Return

Value of the searched parameter in the requested type, null if the parameter is not found on the OS environment variables or in JVM system properties.

Parameters

type

Type of the requested parameter. Supported types are: boolean, int, long, float, double and string, throw an error if other type is supplied.

name

Name of the searched parameter, can not be blank.


inline fun <T : Any> systemSettingOrNull(name: String): T?

Utility method for retrieving a system setting, check systemSettingOrNull for details.

Return

Value of the searched parameter in the requested type, null if the parameter is not found on the OS environment variables or in JVM system properties.

Parameters

T

Type of the requested parameter. Supported types are: boolean, int, long, float, double and string, throw an error if other type is supplied.

name

Name of the searched parameter, can not be blank.