Package org.pkl.config.java.mapper
Interface ConverterFactory
- All Known Implementing Classes:
PObjectToDataObject,PObjectToMap
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A factory for
Converters. Used to implement conversions to generic Java classes. In such
a case a single Converter does not suffice. Instead, the factory creates a new converter
for every parameterization of the target type. Once created, the converter is cached for later
use, and the factory is never again invoked for the same parameterized target type.
For best performance, all introspection of target types (for example using Reflection)
should happen in the factory rather than the returned converters.
-
Method Summary
Modifier and TypeMethodDescriptionReturns a converter for the given source and target types, orOptional.empty()if the factory cannot handle the requested types.default ConverterFactoryReturns a new factory that restricts use of this factory to target types for which the given predicate holds.
-
Method Details
-
create
Returns a converter for the given source and target types, orOptional.empty()if the factory cannot handle the requested types. -
when
Returns a new factory that restricts use of this factory to target types for which the given predicate holds.
-