public class ConfigurationUtils extends Object
Configuration
.Constructor and Description |
---|
ConfigurationUtils() |
Modifier and Type | Method and Description |
---|---|
static String |
getNonEmptyString(com.sdl.delivery.configuration.Configuration configuration,
String valueName,
String errorMessage)
Get the configuration value as type
String from the given configuration and value name. |
static Optional<com.sdl.delivery.configuration.Value> |
getValue(com.sdl.delivery.configuration.Configuration configuration,
String valueName)
Get the configuration value from the given configuration and value name.
|
static com.sdl.delivery.configuration.Value |
getValue(com.sdl.delivery.configuration.Configuration configuration,
String valueName,
String errorMessage)
Get the configuration value from the given configuration and value name.
|
public static String getNonEmptyString(com.sdl.delivery.configuration.Configuration configuration, String valueName, String errorMessage) throws com.sdl.delivery.configuration.ConfigurationException
String
from the given configuration and value name. In case the value
is not present or is an empty String
, a ConfigurationException
with the given message is thrown.
This means that if there is a value is guaranteed to not be null
neither empty.configuration
- The given configuration. It can not be null
.valueName
- The given value name. It can not be @{code null} nor empty.errorMessage
- The error message that should appear in the ConfigurationException
when thrown. It
can not be null
nor empty.null
.com.sdl.delivery.configuration.ConfigurationException
- In case the value can not be found.public static com.sdl.delivery.configuration.Value getValue(com.sdl.delivery.configuration.Configuration configuration, String valueName, String errorMessage) throws com.sdl.delivery.configuration.ConfigurationException
ConfigurationException
with the given message is thrown. This means that if there is a value is
guaranteed to not be null
.configuration
- The given configuration. It can not be null
.valueName
- The given value name. It can not be @{code null} nor empty.errorMessage
- The error message that should appear in the ConfigurationException
when thrown. It
can not be null
nor empty.null
.com.sdl.delivery.configuration.ConfigurationException
- In case the value can not be found.public static Optional<com.sdl.delivery.configuration.Value> getValue(com.sdl.delivery.configuration.Configuration configuration, String valueName)
configuration
- The given configuration. It can not be null
.valueName
- The given value name. It can not be @{code null} nor empty.Copyright (c) 2014-2021 All Rights Reserved by the RWS Group for and on behalf of its affiliates and subsidiaries