Package kong.unirest.core
Class GenericType<T>
- java.lang.Object
-
- kong.unirest.core.GenericType<T>
-
- Type Parameters:
T
- the generic type you wish to represent.
- All Implemented Interfaces:
java.lang.Comparable<GenericType<T>>
public abstract class GenericType<T> extends java.lang.Object implements java.lang.Comparable<GenericType<T>>
Parts of this file were taken from Jackson/core TypeReference under the Apache License: Apache (Software) License, version 2.0 ("the License"). See the License for details about distribution rights, and the specific rights regarding derivate works. You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0 A class to hold onto generic type params for object mapping by creating a anonymous subtype. This is a common "trick" commonly used in Java to avoid issues with type erasure. Other examples can be found in popular libraries like Jackson, GSON, and SpringGenericType ref = new GenericType<List<Integer>>() { };
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.reflect.Type
type
-
Constructor Summary
Constructors Modifier Constructor Description protected
GenericType()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(GenericType<T> o)
java.lang.reflect.Type
getType()
java.lang.Class<?>
getTypeClass()
-
-
-
Method Detail
-
getType
public java.lang.reflect.Type getType()
- Returns:
- the Type which includes generic type information
-
compareTo
public int compareTo(GenericType<T> o)
- Specified by:
compareTo
in interfacejava.lang.Comparable<T>
-
getTypeClass
public java.lang.Class<?> getTypeClass()
-
-