@Deprecated public class GenericType<T> extends Object
Type genericType = (new GenericType<List<String>>() {}).getGenericType();
The above code will get you the genericType for List<String> N.B. This class is replaced by javax.ws.rs.core.GenericType.
GenericType
Modifier | Constructor and Description |
---|---|
protected |
GenericType()
Deprecated.
Constructs a new generic entity.
|
Modifier and Type | Method and Description |
---|---|
Type |
getGenericType()
Deprecated.
Gets underlying
Type instance. |
Class<T> |
getType()
Deprecated.
Gets the raw type of the enclosed entity.
|
protected GenericType()
public final Class<T> getType()
ArrayList
not List
.public final 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>
.Copyright © 2021 JBoss by Red Hat. All rights reserved.