public final class TypeVariableName extends TypeName
Modifier and Type | Field and Description |
---|---|
java.util.List<TypeName> |
bounds |
java.lang.String |
name |
Modifier | Constructor and Description |
---|---|
private |
TypeVariableName(java.lang.String name,
java.util.List<TypeName> bounds) |
private |
TypeVariableName(java.lang.String name,
java.util.List<TypeName> bounds,
java.util.List<AnnotationSpec> annotations) |
Modifier and Type | Method and Description |
---|---|
TypeVariableName |
annotated(java.util.List<AnnotationSpec> annotations) |
(package private) CodeWriter |
emit(CodeWriter out) |
static TypeVariableName |
get(java.lang.String name)
Returns type variable named
name without bounds. |
static TypeVariableName |
get(java.lang.String name,
java.lang.reflect.Type... bounds)
Returns type variable named
name with bounds . |
static TypeVariableName |
get(java.lang.String name,
TypeName... bounds)
Returns type variable named
name with bounds . |
static TypeVariableName |
get(javax.lang.model.element.TypeParameterElement element)
Returns type variable equivalent to
element . |
static TypeVariableName |
get(javax.lang.model.type.TypeVariable mirror)
Returns type variable equivalent to
mirror . |
static TypeVariableName |
get(java.lang.reflect.TypeVariable<?> type)
Returns type variable equivalent to
type . |
(package private) static TypeVariableName |
get(java.lang.reflect.TypeVariable<?> type,
java.util.Map<java.lang.reflect.Type,TypeVariableName> map) |
(package private) static TypeVariableName |
get(javax.lang.model.type.TypeVariable mirror,
java.util.Map<javax.lang.model.element.TypeParameterElement,TypeVariableName> typeVariables)
Make a TypeVariableName for the given TypeMirror.
|
private static TypeVariableName |
of(java.lang.String name,
java.util.List<TypeName> bounds) |
TypeVariableName |
withBounds(java.util.List<TypeName> bounds) |
TypeVariableName |
withBounds(java.lang.reflect.Type... bounds) |
TypeVariableName |
withBounds(TypeName... bounds) |
TypeName |
withoutAnnotations() |
annotated, arrayComponent, box, concatAnnotations, emitAnnotations, equals, get, get, get, get, hashCode, isAnnotated, isBoxedPrimitive, isPrimitive, list, list, toString, unbox
public final java.lang.String name
public final java.util.List<TypeName> bounds
private TypeVariableName(java.lang.String name, java.util.List<TypeName> bounds)
private TypeVariableName(java.lang.String name, java.util.List<TypeName> bounds, java.util.List<AnnotationSpec> annotations)
public TypeVariableName annotated(java.util.List<AnnotationSpec> annotations)
public TypeName withoutAnnotations()
withoutAnnotations
in class TypeName
public TypeVariableName withBounds(java.lang.reflect.Type... bounds)
public TypeVariableName withBounds(TypeName... bounds)
public TypeVariableName withBounds(java.util.List<TypeName> bounds)
private static TypeVariableName of(java.lang.String name, java.util.List<TypeName> bounds)
CodeWriter emit(CodeWriter out) throws java.io.IOException
public static TypeVariableName get(java.lang.String name)
name
without bounds.public static TypeVariableName get(java.lang.String name, TypeName... bounds)
name
with bounds
.public static TypeVariableName get(java.lang.String name, java.lang.reflect.Type... bounds)
name
with bounds
.public static TypeVariableName get(javax.lang.model.type.TypeVariable mirror)
mirror
.static TypeVariableName get(javax.lang.model.type.TypeVariable mirror, java.util.Map<javax.lang.model.element.TypeParameterElement,TypeVariableName> typeVariables)
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.public static TypeVariableName get(javax.lang.model.element.TypeParameterElement element)
element
.public static TypeVariableName get(java.lang.reflect.TypeVariable<?> type)
type
.static TypeVariableName get(java.lang.reflect.TypeVariable<?> type, java.util.Map<java.lang.reflect.Type,TypeVariableName> map)
get(java.lang.reflect.TypeVariable, Map)