public final class SystemSettingUtils extends Object
SystemSetting
.Modifier and Type | Method and Description |
---|---|
static Optional<String> |
resolveNonDefaultSetting(SystemSetting setting)
Resolve the value of this system setting, loading it from the System by checking:
The system properties.
The environment variables.
|
static Optional<String> |
resolveSetting(SystemSetting setting)
Resolve the value of this system setting, loading it from the System by checking:
The system properties.
The environment variables.
The default value.
|
static Boolean |
safeStringToBoolean(SystemSetting setting,
String value)
Convert a string to boolean safely (as opposed to the less strict
Boolean.parseBoolean(String) ). |
public static Optional<String> resolveSetting(SystemSetting setting)
public static Optional<String> resolveNonDefaultSetting(SystemSetting setting)
This is similar to resolveSetting(SystemSetting)
but does not fall back to the default value if neither
the environment variable or system property value are present.
public static Boolean safeStringToBoolean(SystemSetting setting, String value)
Boolean.parseBoolean(String)
). If a customer
specifies a boolean value it should be "true" or "false" (case insensitive) or an exception will be thrown.Copyright © 2021. All rights reserved.