Class ConfigurationInterpolator.DefaultStringConverter
java.lang.Object
org.apache.commons.configuration2.interpol.ConfigurationInterpolator.DefaultStringConverter
- Enclosing class:
- ConfigurationInterpolator
private static final class ConfigurationInterpolator.DefaultStringConverter
extends Object
implements Function<Object,String>
Class encapsulating the default logic to convert resolved variable values into strings.
This class is thread-safe.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final ConfigurationInterpolator.DefaultStringConverter
Shared instance. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate Object
extractSimpleValue
(Object obj) Attempt to extract a simple value fromobj
for use in string conversion.private <T> T
nextOrNull
(Iterator<T> it) Return the next value fromit
ornull
if no values remain.
-
Field Details
-
INSTANCE
Shared instance.
-
-
Constructor Details
-
DefaultStringConverter
private DefaultStringConverter()
-
-
Method Details
-
apply
-
extractSimpleValue
Attempt to extract a simple value fromobj
for use in string conversion. If the input represents a collection of some sort (e.g., an iterable or array), the first item from the collection is returned.- Parameters:
obj
- input object- Returns:
- extracted simple object
-
nextOrNull
Return the next value fromit
ornull
if no values remain.- Type Parameters:
T
- iterated type- Parameters:
it
- iterator- Returns:
- next value from
it
ornull
if no values remain
-