Class Conversion<S,​T>

  • Type Parameters:
    S - Java type representing the Pkl source type
    T - Java target type

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

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <S,​T>
      Conversion<S,​T>
      of​(org.pkl.core.PClassInfo<S> sourceType, java.lang.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, java.lang.reflect.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 Detail

      • sourceType

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

        public final java.lang.reflect.Type targetType
      • converter

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

      • of

        public static <S,​T> Conversion<S,​T> of​(org.pkl.core.PClassInfo<S> sourceType,
                                                           java.lang.reflect.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,
                                                           java.lang.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.