Class Conversion<S,T>

java.lang.Object
org.pkl.config.java.mapper.Conversion<S,T>
Type Parameters:
S - Java type representing the Pkl source type
T - Java target type

public final class Conversion<S,T> extends Object
Describes a conversion from a Pkl source type to a (possibly parameterized) Java target type, performed by the given Converter.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final Converter<? super S,? extends T>
     
    final org.pkl.core.PClassInfo<S>
     
    final Type
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static <S, T> Conversion<S,T>
    of(org.pkl.core.PClassInfo<S> sourceType, Class<T> targetType, Converter<? super S,? extends T> converter)
    Creates a conversion from the given Pkl source type to the given non-parameterized Java type, using the given converter.
    static <S, T> Conversion<S,T>
    of(org.pkl.core.PClassInfo<S> sourceType, Type targetType, Converter<? super S,? extends T> converter)
    Creates a conversion from the given Pkl source type to the given (possibly parameterized) Java type, using the given converter.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • sourceType

      public final org.pkl.core.PClassInfo<S> sourceType
    • targetType

      public final Type targetType
    • converter

      public final Converter<? super S,? extends T> converter
  • Method Details

    • of

      public static <S, T> Conversion<S,T> of(org.pkl.core.PClassInfo<S> sourceType, Type targetType, Converter<? super S,? extends T> converter)
      Creates a conversion from the given Pkl source type to the given (possibly parameterized) Java type, using the given converter.
    • of

      public static <S, T> Conversion<S,T> of(org.pkl.core.PClassInfo<S> sourceType, Class<T> targetType, Converter<? super S,? extends T> converter)
      Creates a conversion from the given Pkl source type to the given non-parameterized Java type, using the given converter. This overload is provided to allow for better type inference.