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 | 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() |
int |
hashCode() |
java.lang.String |
toString() |
public final java.lang.reflect.Type getType()
public final java.lang.Class<T> getRawType()
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