public final class TypeDef extends Object implements Serializable
This class represents a Type Definition. A Type Definition specifies which type parameters (if any) can a class take, and the relation that exists among them. It corresponds to the way a class can be defined in its .java file.
Examples of type definitions are:
These type definitions serve as a template for creating types (Type
class), which
resolve all type variables present in the type definition (for example, for a TypeDef
object java.util.Collection<E> we can get a Type object
java.util.Collection<java.lang.String>
Objects of this class are never created directly. To obtain a TypeDef object,
the diverse methods in the TypeDefs
class should be used.
Objects of this class are immutable, and thus thread-safe. Also, in order to avoid excessive memory usage, an internal synchronized cache exists which prevents the same TypeDef from being instantiated more than once (so, if two TypeDef objects are equal, this will mean that they are the same object).
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
Class<?> |
getComponentClass()
Returns the component class of the type definition.
|
String |
getName()
Returns the name of the type definition.
|
TypeDefVariable[] |
getVariables()
Returns the variables of the type definition.
|
int |
hashCode() |
String |
toString() |
public Class<?> getComponentClass()
public TypeDefVariable[] getVariables()
public String getName()
Copyright © 2016 The JAVARUNTYPE team. All Rights Reserved.