T - Type to be inferred.public abstract class TypeHolder<T>
extends java.lang.Object
ParameterizedTypes for a child class.
This type can be retrieved from type().
In order to use this, one has to create an anonymous sub-class, like:
TypeHolder<Set<String>> holder = new TypeHolder<Set<String>>() { };
This implementation is based on the samples provided in
this article..| Modifier | Constructor and Description |
|---|---|
protected |
TypeHolder()
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.reflect.Type |
type()
Returns the inferred generic type for this
TypeHolder. |
public final java.lang.reflect.Type type()
TypeHolder.TypeHolder.