public final class WildcardTypeName extends TypeName
Modifier and Type | Field and Description |
---|---|
java.util.List<TypeName> |
lowerBounds |
java.util.List<TypeName> |
upperBounds |
Modifier | Constructor and Description |
---|---|
private |
WildcardTypeName(java.util.List<TypeName> upperBounds,
java.util.List<TypeName> lowerBounds) |
private |
WildcardTypeName(java.util.List<TypeName> upperBounds,
java.util.List<TypeName> lowerBounds,
java.util.List<AnnotationSpec> annotations) |
Modifier and Type | Method and Description |
---|---|
WildcardTypeName |
annotated(java.util.List<AnnotationSpec> annotations) |
(package private) CodeWriter |
emit(CodeWriter out) |
static TypeName |
get(javax.lang.model.type.WildcardType mirror) |
static TypeName |
get(java.lang.reflect.WildcardType wildcardName) |
(package private) static TypeName |
get(javax.lang.model.type.WildcardType mirror,
java.util.Map<javax.lang.model.element.TypeParameterElement,TypeVariableName> typeVariables) |
(package private) static TypeName |
get(java.lang.reflect.WildcardType wildcardName,
java.util.Map<java.lang.reflect.Type,TypeVariableName> map) |
static WildcardTypeName |
subtypeOf(java.lang.reflect.Type upperBound) |
static WildcardTypeName |
subtypeOf(TypeName upperBound)
Returns a type that represents an unknown type that extends
bound . |
static WildcardTypeName |
supertypeOf(java.lang.reflect.Type lowerBound) |
static WildcardTypeName |
supertypeOf(TypeName lowerBound)
Returns a type that represents an unknown supertype of
bound . |
TypeName |
withoutAnnotations() |
annotated, arrayComponent, box, concatAnnotations, emitAnnotations, equals, get, get, get, get, hashCode, isAnnotated, isBoxedPrimitive, isPrimitive, list, list, toString, unbox
public final java.util.List<TypeName> upperBounds
public final java.util.List<TypeName> lowerBounds
private WildcardTypeName(java.util.List<TypeName> upperBounds, java.util.List<TypeName> lowerBounds)
private WildcardTypeName(java.util.List<TypeName> upperBounds, java.util.List<TypeName> lowerBounds, java.util.List<AnnotationSpec> annotations)
public WildcardTypeName annotated(java.util.List<AnnotationSpec> annotations)
public TypeName withoutAnnotations()
withoutAnnotations
in class TypeName
CodeWriter emit(CodeWriter out) throws java.io.IOException
public static WildcardTypeName subtypeOf(TypeName upperBound)
bound
. For example, if
bound
is CharSequence.class
, this returns ? extends CharSequence
. If
bound
is Object.class
, this returns ?
, which is shorthand for ? extends Object
.public static WildcardTypeName subtypeOf(java.lang.reflect.Type upperBound)
public static WildcardTypeName supertypeOf(TypeName lowerBound)
bound
. For example, if bound
is String.class
, this returns ? super String
.public static WildcardTypeName supertypeOf(java.lang.reflect.Type lowerBound)
public static TypeName get(javax.lang.model.type.WildcardType mirror)
static TypeName get(javax.lang.model.type.WildcardType mirror, java.util.Map<javax.lang.model.element.TypeParameterElement,TypeVariableName> typeVariables)
public static TypeName get(java.lang.reflect.WildcardType wildcardName)
static TypeName get(java.lang.reflect.WildcardType wildcardName, java.util.Map<java.lang.reflect.Type,TypeVariableName> map)