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.DefaultStringConverterShared instance. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate ObjectextractSimpleValue(Object obj) Attempt to extract a simple value fromobjfor use in string conversion.private <T> TnextOrNull(Iterator<T> it) Return the next value fromitornullif no values remain.
-
Field Details
-
INSTANCE
Shared instance.
-
-
Constructor Details
-
DefaultStringConverter
private DefaultStringConverter()
-
-
Method Details
-
apply
-
extractSimpleValue
Attempt to extract a simple value fromobjfor 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 fromitornullif no values remain.- Type Parameters:
T- iterated type- Parameters:
it- iterator- Returns:
- next value from
itornullif no values remain
-