|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.ws.rs.core.TypeLiteral<T>
T - the generic type parameter.public abstract class TypeLiteral<T>
Supports in-line instantiation of objects that represent parameterized
types with actual type parameters.
An object that represents any parameterized type may be obtained by
sub-classing TypeLiteral.
TypeLiteral<List<String>> stringListType = new TypeLiteral<List<String>>() {};
| Constructor Summary | |
|---|---|
protected |
TypeLiteral()
Protected constructor for a type literal of a concrete Java type. |
| Method Summary | ||
|---|---|---|
boolean |
equals(Object obj)
|
|
Type[] |
getParameterTypes()
Retrieve an array of Type objects representing the actual type
arguments to the type represented by this type literal. |
|
Class<T> |
getRawType()
Returns the object representing the class or interface that declared the type represented by this type literal instance. |
|
Type |
getType()
Retrieve the type represented by the type literal instance. |
|
int |
hashCode()
|
|
static
|
of(Class<?> rawType,
Type type)
Construct a type literal instance with programmatically set values of type and raw type. |
|
String |
toString()
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
protected TypeLiteral()
| Method Detail |
|---|
public static <T> TypeLiteral<T> of(Class<?> rawType,
Type type)
T - Java type.rawType - raw parameter type.type - parameter type (possibly generic).
public final Type getType()
public final Type[] getParameterTypes()
Type objects representing the actual type
arguments to the type represented by this type literal.
Note that in some cases, the returned array may be empty. This can occur
if the type represented by this type literal is a non-parameterized type.
Type objects representing the actual type
arguments to this type.
TypeNotPresentException - if any of the actual type arguments
refers to a non-existent type declaration.
MalformedParameterizedTypeException - if any of the
actual type parameters refer to a parameterized type that cannot
be instantiated for any reason.public final Class<T> getRawType()
public boolean equals(Object obj)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||