@Deprecated
public class GenericType<T>
extends java.lang.Object
Type genericType = (new GenericTypeThe above code will get you the genericType for List>() {}).getGenericType();
GenericType
Modifier and Type | Field and Description |
---|---|
(package private) java.lang.reflect.Type |
genericType
Deprecated.
|
(package private) java.lang.Class<T> |
type
Deprecated.
|
Modifier | Constructor and Description |
---|---|
protected |
GenericType()
Deprecated.
Constructs a new generic entity.
|
Modifier and Type | Method and Description |
---|---|
java.lang.reflect.Type |
getGenericType()
Deprecated.
Gets underlying
Type instance. |
java.lang.Class<T> |
getType()
Deprecated.
Gets the raw type of the enclosed entity.
|
final java.lang.Class<T> type
final java.lang.reflect.Type genericType
protected GenericType()
entity
- the entity instance, must not be nulljava.lang.IllegalArgumentException
- if entity is nullpublic final java.lang.Class<T> getType()
ArrayList
not List
.public final java.lang.reflect.Type getGenericType()
Type
instance. Note that this is derived from the
type parameter, not the enclosed instance. I.e. in the example
in the introduction, the type is List<String>
not
ArrayList<String>
.