public interface SystemSetting
System
using methods like
getStringValue()
.Modifier and Type | Method and Description |
---|---|
String |
defaultValue()
The default value of the setting (or empty if there is no default).
|
String |
environmentVariable()
The environment variable of the setting (or null if there is no environment variable for this setting).
|
default Optional<Boolean> |
getBooleanValue()
Attempt to load a system setting from
System.getProperty(String) and System.getenv(String) . |
default Boolean |
getBooleanValueOrThrow()
Load the requested system setting as per the documentation in
getBooleanValue() , throwing an
exception if the value was not set and had no default. |
default Optional<Integer> |
getIntegerValue()
Attempt to load a system setting from
System.getProperty(String) and System.getenv(String) . |
default Integer |
getIntegerValueOrThrow()
Load the requested system setting as per the documentation in
getIntegerValue() , throwing an exception if the
value was not set and had no default. |
default Optional<String> |
getNonDefaultStringValue()
Attempt to load a system setting from
System.getProperty(String) and System.getenv(String) . |
default Optional<String> |
getStringValue()
Attempt to load a system setting from
System.getProperty(String) and System.getenv(String) . |
default String |
getStringValueOrThrow()
Load the requested system setting as per the documentation in
getStringValue() , throwing an exception if the value
was not set and had no default. |
String |
property()
The system property of the setting (or null if there is no property for this setting).
|
String property()
String environmentVariable()
String defaultValue()
default Optional<String> getStringValue()
System.getProperty(String)
and System.getenv(String)
. This should be
used in favor of those methods because the SDK should support both methods of configuration.
System.getProperty(String)
takes precedent over System.getenv(String)
if both are specified.Optional.empty()
if the values were not set, or the security manager did not
allow reading the setting.default Optional<String> getNonDefaultStringValue()
System.getProperty(String)
and System.getenv(String)
. This should be
used in favor of those methods because the SDK should support both methods of configuration.
System.getProperty(String)
takes precedent over System.getenv(String)
if both are specified.
Similar to getStringValue()
, but does not fall back to the default value.
Optional.empty()
if the values were not set, or the security manager did not
allow reading the setting.default String getStringValueOrThrow()
getStringValue()
, throwing an exception if the value
was not set and had no default.default Optional<Integer> getIntegerValue()
System.getProperty(String)
and System.getenv(String)
. This should be
used in favor of those methods because the SDK should support both methods of configuration.
The result will be converted to an integer.
System.getProperty(String)
takes precedent over System.getenv(String)
if both are specified.Optional.empty()
if the values were not set, or the security manager did not
allow reading the setting.default Integer getIntegerValueOrThrow()
getIntegerValue()
, throwing an exception if the
value was not set and had no default.default Optional<Boolean> getBooleanValue()
System.getProperty(String)
and System.getenv(String)
. This should be
used in favor of those methods because the SDK should support both methods of configuration.
The result will be converted to a boolean.
System.getProperty(String)
takes precedent over System.getenv(String)
if both are specified.Optional.empty()
if the values were not set, or the security manager did not
allow reading the setting.default Boolean getBooleanValueOrThrow()
getBooleanValue()
, throwing an
exception if the value was not set and had no default.Copyright © 2021. All rights reserved.