T - the configuration data type returned by this Sourcepublic interface Source<T>
| Modifier and Type | Method and Description |
|---|---|
T |
load(Mapper<T> mapper)
Applies a specific configuration loading strategy and returns the retrieved data,
throwing an exception if the operation fails.
|
Optional<T> |
load(Mapper<T> mapper,
boolean optional)
Applies a specific configuration loading strategy and returns an
Optional,
possibly containing the retrieved data. |
T load(Mapper<T> mapper)
mapper - the Mapper to be applied on the source input streamConfigurationSourceException - in an event of failure to load the configuration
sourceOptional<T> load(Mapper<T> mapper, boolean optional)
Optional,
possibly containing the retrieved data. If the optional parameter is
true and the operation fails, then Optional.empty() is returned.mapper - the Mapper to be applied on the source input streamoptional - a flag indicating whether or not an exception should be thrown in an
event of failure to load the configuration sourceoptional flag set as trueConfigurationSourceException - in an event of failure to load the configuration
source, with the optional flag set as
falseCopyright © 2021. All rights reserved.