T
- the type, including all actual type parameterspublic abstract class TypeLiteral<T>
extends java.lang.Object
implements java.io.Serializable
Supports inline instantiation of objects that represent parameterized types with actual type parameters.
An object that represents any parameterized type may be obtained by subclassing TypeLiteral.
TypeLiteral<List<String>> stringListType = new TypeLiteral<List<String>>() { };
Modifier and Type | Field and Description |
---|---|
private java.lang.reflect.Type |
actualType |
private static long |
serialVersionUID |
Modifier | Constructor and Description |
---|---|
protected |
TypeLiteral() |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
java.lang.Class<T> |
getRawType() |
java.lang.reflect.Type |
getType() |
private static java.lang.Class<?> |
getTypeLiteralSubclass(java.lang.Class<?> clazz) |
private static java.lang.reflect.Type |
getTypeParameter(java.lang.Class<?> superclass) |
int |
hashCode() |
java.lang.String |
toString() |
private static final long serialVersionUID
private transient java.lang.reflect.Type actualType
public final java.lang.reflect.Type getType()
public final java.lang.Class<T> getRawType()
private static java.lang.Class<?> getTypeLiteralSubclass(java.lang.Class<?> clazz)
private static java.lang.reflect.Type getTypeParameter(java.lang.Class<?> superclass)
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object