Class ConfigurationInterpolator.DefaultStringConverter

java.lang.Object
org.apache.commons.configuration2.interpol.ConfigurationInterpolator.DefaultStringConverter
All Implemented Interfaces:
Function<Object,String>
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 Details

  • Constructor Details

    • DefaultStringConverter

      private DefaultStringConverter()
  • Method Details

    • apply

      public String apply(Object obj)
      Specified by:
      apply in interface Function<Object,String>
    • extractSimpleValue

      private Object extractSimpleValue(Object obj)
      Attempt to extract a simple value from obj 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

      private <T> T nextOrNull(Iterator<T> it)
      Return the next value from it or null if no values remain.
      Type Parameters:
      T - iterated type
      Parameters:
      it - iterator
      Returns:
      next value from it or null if no values remain