public class Type extends AbstractModelElement implements Comparable<Type>
TypeMirror, i.e. there are
different instances for e.g. Set<String> and Set<Integer>.
Allows for a unified handling of declared and primitive types and usage within templates. Instances are obtained
through TypeFactory.
ModelElement.Context| Constructor and Description |
|---|
Type(TypeMirror typeMirror,
List<Type> typeParameters,
Type implementationType,
boolean isIterableType,
boolean isCollectionType,
boolean isMapType,
Types typeUtils,
Elements elementUtils) |
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(Type o) |
boolean |
equals(Object obj) |
String |
getFullyQualifiedName() |
Type |
getImplementationType()
Returns the implementation type to be instantiated in case this type is an interface iterable, collection or map
type.
|
Set<Type> |
getImportTypes()
Returns a set containing those
Types referenced by this model
element for which an import statement needs to be declared. |
String |
getName() |
String |
getPackageName() |
TypeElement |
getTypeElement() |
TypeMirror |
getTypeMirror() |
List<Type> |
getTypeParameters() |
int |
hashCode() |
boolean |
isAssignableTo(Type other)
Whether this type is assignable to the given other type.
|
boolean |
isCollectionType() |
boolean |
isEnumType() |
boolean |
isInterface() |
boolean |
isIterableType() |
boolean |
isMapType() |
boolean |
isPrimitive() |
String |
toString() |
writepublic TypeMirror getTypeMirror()
public TypeElement getTypeElement()
public String getPackageName()
public String getName()
public boolean isPrimitive()
public boolean isInterface()
public boolean isEnumType()
public Type getImplementationType()
Set<String>, the
implementation type is HashSet<String>.null otherwise.public boolean isIterableType()
public boolean isCollectionType()
public boolean isMapType()
public String getFullyQualifiedName()
public Set<Type> getImportTypes()
ModelElementTypes referenced by this model
element for which an import statement needs to be declared.getImportTypes in interface ModelElementnull.public boolean isAssignableTo(Type other)
other - The other type.true if and only if this type is assignable to the given other type.public int compareTo(Type o)
compareTo in interface Comparable<Type>Copyright © 2012-2013. All Rights Reserved.