Package org.jboss.resteasy.util
Class GenericType<T>
- java.lang.Object
-
- org.jboss.resteasy.util.GenericType<T>
-
@Deprecated public class GenericType<T> extends java.lang.Object
Deprecated.Replaced by javax.ws.rs.core.GenericTypeThis class is a trick used to extract GenericType information at runtime. Java does not allow you get generic type information easily, so this class does the trick. For example:Type genericType = (new GenericType
The above code will get you the genericType for List- >() {}).getGenericType();
N.B. This class is replaced by javax.ws.rs.core.GenericType. - Version:
- $Revision: 1 $
- See Also:
GenericType
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.lang.reflect.Type
genericType
Deprecated.(package private) java.lang.Class<T>
type
Deprecated.
-
Constructor Summary
Constructors Modifier Constructor Description protected
GenericType()
Deprecated.Constructs a new generic entity.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.lang.reflect.Type
getGenericType()
Deprecated.Gets underlyingType
instance.java.lang.Class<T>
getType()
Deprecated.Gets the raw type of the enclosed entity.
-
-
-
Field Detail
-
type
final java.lang.Class<T> type
Deprecated.
-
genericType
final java.lang.reflect.Type genericType
Deprecated.
-
-
Constructor Detail
-
GenericType
protected GenericType()
Deprecated.Constructs a new generic entity. Derives represented class from type parameter. Note that this constructor is protected, users should create a (usually anonymous) subclass as shown above.- Parameters:
entity
- the entity instance, must not be null- Throws:
java.lang.IllegalArgumentException
- if entity is null
-
-
Method Detail
-
getType
public final java.lang.Class<T> getType()
Deprecated.Gets the raw type of the enclosed entity. Note that this is the raw type of the instance, not the raw type of the type parameter. I.e. in the example in the introduction, the raw type isArrayList
notList
.- Returns:
- the raw type
-
getGenericType
public final java.lang.reflect.Type getGenericType()
Deprecated.Gets underlyingType
instance. Note that this is derived from the type parameter, not the enclosed instance. I.e. in the example in the introduction, the type isList<String>
notArrayList<String>
.- Returns:
- the type
-
-