org.glassfish.hk2
Class TypeLiteral<T>
java.lang.Object
org.glassfish.hk2.TypeLiteral<T>
- Type Parameters:
T -
public abstract class TypeLiteral<T>
- extends java.lang.Object
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>>() {};
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
TypeLiteral
protected TypeLiteral()
getType
public final java.lang.reflect.Type getType()
- Returns:
- the actual type represented by this object
getParameterTypes
public final java.lang.reflect.Type[] getParameterTypes()
getRawType
public final java.lang.Class<T> getRawType()
- Returns:
- the raw type represented by this object
getRawType
public static java.lang.Class<?> getRawType(java.lang.reflect.Type type)
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals in class java.lang.Object
hashCode
public int hashCode()
- Overrides:
hashCode in class java.lang.Object
toString
public java.lang.String toString()
- Overrides:
toString in class java.lang.Object
Copyright © 2011 Oracle Corporation. All Rights Reserved.