Package software.amazon.awssdk.utils
Interface SystemSetting
- All Known Implementing Classes:
JavaSystemSetting
,ProfileFileSystemSetting
,ProxyEnvironmentSetting
,ProxySystemSetting
,S3SystemSetting
,SdkSystemSetting
,TracingSystemSetting
public interface SystemSetting
An interface implemented by enums in other packages in order to define the system settings the want loaded. An enum
is expected to implement this interface, and then have values loaded from the
System
using methods like
getStringValue()
.-
Method Summary
Modifier and TypeMethodDescriptionThe default value of the setting (or empty if there is no default).The environment variable of the setting (or null if there is no environment variable for this setting).Attempt to load a system setting fromSystem.getProperty(String)
andSystem.getenv(String)
.default Boolean
Load the requested system setting as per the documentation ingetBooleanValue()
, throwing an exception if the value was not set and had no default.Attempt to load a system setting fromSystem.getProperty(String)
andSystem.getenv(String)
.default Integer
Load the requested system setting as per the documentation ingetIntegerValue()
, throwing an exception if the value was not set and had no default.Attempt to load a system setting fromSystem.getProperty(String)
andSystem.getenv(String)
.Attempt to load a system setting fromSystem.getProperty(String)
andSystem.getenv(String)
.Attempt to load a system setting fromSystem.getenv(String)
.default String
Load the requested system setting as per the documentation ingetStringValue()
, throwing an exception if the value was not set and had no default.property()
The system property of the setting (or null if there is no property for this setting).
-
Method Details
-
property
String property()The system property of the setting (or null if there is no property for this setting). -
environmentVariable
String environmentVariable()The environment variable of the setting (or null if there is no environment variable for this setting). -
defaultValue
String defaultValue()The default value of the setting (or empty if there is no default). This value will be applied if the customer did not specify a setting. -
getStringValue
Attempt to load a system setting fromSystem.getProperty(String)
andSystem.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 overSystem.getenv(String)
if both are specified.- Returns:
- The requested setting, or
Optional.empty()
if the values were not set, or the security manager did not allow reading the setting.
-
getStringValueFromEnvironmentVariable
Attempt to load a system setting fromSystem.getenv(String)
. This should NOT BE USED, so checkstyle will complain about using it. The only reason this is made available is for when we ABSOLUTELY CANNOT support a system property for a specific setting. That should be the exception, NOT the rule. We should almost always provide a system property alternative for all environment variables.- Returns:
- The requested setting, or
Optional.empty()
if the values were not set, or the security manager did not allow reading the setting.
-
getNonDefaultStringValue
Attempt to load a system setting fromSystem.getProperty(String)
andSystem.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 overSystem.getenv(String)
if both are specified.Similar to
getStringValue()
, but does not fall back to the default value.- Returns:
- The requested setting, or
Optional.empty()
if the values were not set, or the security manager did not allow reading the setting.
-
getStringValueOrThrow
Load the requested system setting as per the documentation ingetStringValue()
, throwing an exception if the value was not set and had no default.- Returns:
- The requested setting.
-
getIntegerValue
Attempt to load a system setting fromSystem.getProperty(String)
andSystem.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 overSystem.getenv(String)
if both are specified.- Returns:
- The requested setting, or
Optional.empty()
if the values were not set, or the security manager did not allow reading the setting.
-
getIntegerValueOrThrow
Load the requested system setting as per the documentation ingetIntegerValue()
, throwing an exception if the value was not set and had no default.- Returns:
- The requested setting.
-
getBooleanValue
Attempt to load a system setting fromSystem.getProperty(String)
andSystem.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 overSystem.getenv(String)
if both are specified.- Returns:
- The requested setting, or
Optional.empty()
if the values were not set, or the security manager did not allow reading the setting.
-
getBooleanValueOrThrow
Load the requested system setting as per the documentation ingetBooleanValue()
, throwing an exception if the value was not set and had no default.- Returns:
- The requested setting.
-