Class TypeLiteral<T>

java.lang.Object
com.jsoniter.spi.TypeLiteral<T>

public class TypeLiteral<T> extends Object
  • Field Details

  • Constructor Details

    • TypeLiteral

      protected TypeLiteral()
      Constructs a new type literal. Derives represented class from type parameter. Clients create an empty anonymous subclass. Doing so embeds the type parameter in the anonymous class's type hierarchy so we can reconstitute it at runtime despite erasure.
    • TypeLiteral

      public TypeLiteral(Type type, String decoderCacheKey, String encoderCacheKey)
  • Method Details

    • create

      public static TypeLiteral create(Type valueType)
    • getType

      public Type getType()
    • getDecoderCacheKey

      public String getDecoderCacheKey()
    • getDecoderCacheKey

      public String getDecoderCacheKey(String configName)
    • getEncoderCacheKey

      public String getEncoderCacheKey()
    • getEncoderCacheKey

      public String getEncoderCacheKey(String configName)
    • getNativeType

      public TypeLiteral.NativeType getNativeType()
    • toString

      public String toString()
      Overrides:
      toString in class Object