Package com.squareup.javapoet
Class TypeVariableName
java.lang.Object
com.squareup.javapoet.TypeName
com.squareup.javapoet.TypeVariableName
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
TypeVariableName
(String name, List<TypeName> bounds) private
TypeVariableName
(String name, List<TypeName> bounds, List<AnnotationSpec> annotations) -
Method Summary
Modifier and TypeMethodDescriptionannotated
(List<AnnotationSpec> annotations) (package private) CodeWriter
emit
(CodeWriter out) static TypeVariableName
get
(TypeVariable<?> type) Returns type variable equivalent totype
.(package private) static TypeVariableName
get
(TypeVariable<?> type, Map<Type, TypeVariableName> map) static TypeVariableName
Returns type variable namedname
without bounds.static TypeVariableName
Returns type variable namedname
withbounds
.static TypeVariableName
Returns type variable namedname
withbounds
.static TypeVariableName
get
(TypeParameterElement element) Returns type variable equivalent toelement
.static TypeVariableName
get
(TypeVariable mirror) Returns type variable equivalent tomirror
.(package private) static TypeVariableName
get
(TypeVariable mirror, Map<TypeParameterElement, TypeVariableName> typeVariables) Make a TypeVariableName for the given TypeMirror.private static TypeVariableName
withBounds
(TypeName... bounds) withBounds
(Type... bounds) withBounds
(List<? extends TypeName> bounds) Methods inherited from class com.squareup.javapoet.TypeName
annotated, arrayComponent, asArray, box, concatAnnotations, emitAnnotations, equals, get, get, get, get, hashCode, isAnnotated, isBoxedPrimitive, isPrimitive, list, list, toString, unbox
-
Field Details
-
name
-
bounds
-
-
Constructor Details
-
TypeVariableName
-
TypeVariableName
-
-
Method Details
-
annotated
-
withoutAnnotations
- Overrides:
withoutAnnotations
in classTypeName
-
withBounds
-
withBounds
-
withBounds
-
of
-
emit
- Overrides:
emit
in classTypeName
- Throws:
IOException
-
get
Returns type variable namedname
without bounds. -
get
Returns type variable namedname
withbounds
. -
get
Returns type variable namedname
withbounds
. -
get
Returns type variable equivalent tomirror
. -
get
static TypeVariableName get(TypeVariable mirror, Map<TypeParameterElement, TypeVariableName> typeVariables) Make a TypeVariableName for the given TypeMirror. This form is used internally to avoid infinite recursion in cases likeEnum<E extends Enum<E>>
. When we encounter such a thing, we will make a TypeVariableName without bounds and add that to thetypeVariables
map before looking up the bounds. Then if we encounter this TypeVariable again while constructing the bounds, we can just return it from the map. And, the code that put the entry invariables
will make sure that the bounds are filled in before returning. -
get
Returns type variable equivalent toelement
. -
get
Returns type variable equivalent totype
. -
get
- See Also:
-