Top Fields Constructors Methods
com.squareup.javapoet

public final Class TypeVariableName

extends TypeName
Class Inheritance
Imports
java.io.IOException, java.lang.reflect.Type, java.util.ArrayList, .Arrays, .Collections, .LinkedHashMap, .List, .Map, javax.lang.model.element.TypeParameterElement, javax.lang.model.type.TypeMirror, .TypeVariable

Field Summary

Modifier and TypeField and Description
public final List<TypeName>
public final String
Inherited from com.squareup.javapoet.TypeName:
annotationsBOOLEANBYTECHARDOUBLEFLOATINTLONGOBJECTSHORTVOID

Constructor Summary

AccessConstructor and Description
private
private
TypeVariableName(String name, List<TypeName> bounds, List<AnnotationSpec> annotations)

Method Summary

Modifier and TypeMethod and Description
public TypeVariableName
pack-priv CodeWriter
public static TypeVariableName
get(String name)

Returns type variable named name without bounds.

public static TypeVariableName
get(String name, TypeName... bounds)

Returns type variable named name with bounds.

public static TypeVariableName
get(String name, Type... bounds)

Returns type variable named name with bounds.

public static TypeVariableName
get(TypeVariable mirror)

Returns type variable equivalent to mirror.

pack-priv static TypeVariableName
get(TypeVariable mirror, Map<TypeParameterElement, TypeVariableName> typeVariables)

Make a TypeVariableName for the given TypeMirror.

public static TypeVariableName
get(TypeParameterElement element)

Returns type variable equivalent to element.

public static TypeVariableName
get(TypeVariable<?> type)

Returns type variable equivalent to type.

pack-priv static TypeVariableName
private static TypeVariableName
of(String name, List<TypeName> bounds)

public TypeVariableName
withBounds(Type... bounds)

public TypeVariableName
withBounds(TypeName... bounds)

public TypeVariableName
withBounds(List<? extends TypeName> bounds)

public TypeName
Inherited from com.squareup.javapoet.TypeName:
annotatedarrayComponentasArrayboxconcatAnnotationsemitAnnotationsequalsgetgetgetgethashCodeisAnnotatedisBoxedPrimitiveisPrimitivelistlisttoStringunbox

Field Detail

boundsback to summary
public final List<TypeName> bounds
nameback to summary
public final String name

Constructor Detail

TypeVariableNameback to summary
private TypeVariableName(String name, List<TypeName> bounds)
TypeVariableNameback to summary
private TypeVariableName(String name, List<TypeName> bounds, List<AnnotationSpec> annotations)

Method Detail

annotatedback to summary
public TypeVariableName annotated(List<AnnotationSpec> annotations)

Overrides com.squareup.javapoet.TypeName.annotated.

Annotations
@Override
emitback to summary
pack-priv CodeWriter emit(CodeWriter out) throws IOException

Overrides com.squareup.javapoet.TypeName.emit.

Annotations
@Override
getback to summary
public static TypeVariableName get(String name)

Returns type variable named name without bounds.

getback to summary
public static TypeVariableName get(String name, TypeName... bounds)

Returns type variable named name with bounds.

getback to summary
public static TypeVariableName get(String name, Type... bounds)

Returns type variable named name with bounds.

getback to summary
public static TypeVariableName get(TypeVariable mirror)

Returns type variable equivalent to mirror.

getback to summary
pack-priv 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 like Enum<E extends Enum<E>>. When we encounter such a thing, we will make a TypeVariableName without bounds and add that to the typeVariables 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 in variables will make sure that the bounds are filled in before returning.

getback to summary
public static TypeVariableName get(TypeParameterElement element)

Returns type variable equivalent to element.

getback to summary
public static TypeVariableName get(TypeVariable<?> type)

Returns type variable equivalent to type.

getback to summary
pack-priv static TypeVariableName get(TypeVariable<?> type, Map<Type, TypeVariableName> map)
See Also
get(java.lang.reflect.TypeVariable, Map)
ofback to summary
private static TypeVariableName of(String name, List<TypeName> bounds)
withBoundsback to summary
public TypeVariableName withBounds(Type... bounds)
withBoundsback to summary
public TypeVariableName withBounds(TypeName... bounds)
withBoundsback to summary
public TypeVariableName withBounds(List<? extends TypeName> bounds)
withoutAnnotationsback to summary
public TypeName withoutAnnotations()

Overrides com.squareup.javapoet.TypeName.withoutAnnotations.

Annotations
@Override