Interface Conversion<I,O>

Type Parameters:
I - The input type.
O - The output type.
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface Conversion<I,O>
Functional interface representing a single type conversion used by CachingConverter.

The args parameter carries any type arguments needed for parameterized output types. For example, when converting to a List, args[0] would be the element type. For a Map, args[0] is the key type and args[1] is the value type.

A single cached Conversion function can serve all parameterizations of the same raw output type by accepting different args values at runtime.

  • Method Summary

    Modifier and Type
    Method
    Description
    to(I in, Object memberOf, ConverterSession session, Class<?>... args)
    Converts the input object to the output type.
  • Method Details

    • to

      O to(I in, Object memberOf, ConverterSession session, Class<?>... args)
      Converts the input object to the output type.
      Parameters:
      in - The input object.
      memberOf - The outer instance for non-static inner class construction, or null.
      session - The converter session providing contextual objects such as TimeZone or Locale, or null if no session is available.
      args - Optional type arguments for parameterized output types (e.g. element type for collections).
      Returns:
      The converted object.