Class TypeVariableName
java.lang.Object
com.squareup.javapoet.TypeName
com.squareup.javapoet.TypeVariableName
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateTypeVariableName(String name, List<TypeName> bounds) privateTypeVariableName(String name, List<TypeName> bounds, List<AnnotationSpec> annotations) -
Method Summary
Modifier and TypeMethodDescriptionannotated(List<AnnotationSpec> annotations) (package private) CodeWriteremit(CodeWriter out) static TypeVariableNameget(TypeVariable<?> type) Returns type variable equivalent totype.(package private) static TypeVariableNameget(TypeVariable<?> type, Map<Type, TypeVariableName> map) static TypeVariableNameReturns type variable namednamewithout bounds.static TypeVariableNameReturns type variable namednamewithbounds.static TypeVariableNameReturns type variable namednamewithbounds.static TypeVariableNameget(TypeParameterElement element) Returns type variable equivalent toelement.static TypeVariableNameget(TypeVariable mirror) Returns type variable equivalent tomirror.(package private) static TypeVariableNameget(TypeVariable mirror, Map<TypeParameterElement, TypeVariableName> typeVariables) Make a TypeVariableName for the given TypeMirror.private static TypeVariableNamewithBounds(TypeName... bounds) withBounds(Type... bounds) withBounds(List<? extends TypeName> bounds) Methods inherited from class 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:
withoutAnnotationsin classTypeName
-
withBounds
-
withBounds
-
withBounds
-
of
-
emit
- Overrides:
emitin classTypeName- Throws:
IOException
-
get
Returns type variable namednamewithout bounds. -
get
Returns type variable namednamewithbounds. -
get
Returns type variable namednamewithbounds. -
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 thetypeVariablesmap 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 invariableswill 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:
-