Package com.squareup.javapoet
Class WildcardTypeName
- java.lang.Object
-
- com.squareup.javapoet.TypeName
-
- com.squareup.javapoet.WildcardTypeName
-
public final class WildcardTypeName extends TypeName
-
-
Constructor Summary
Constructors Modifier Constructor 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)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description WildcardTypeName
annotated(java.util.List<AnnotationSpec> annotations)
(package private) CodeWriter
emit(CodeWriter out)
static TypeName
get(java.lang.reflect.WildcardType wildcardName)
(package private) static TypeName
get(java.lang.reflect.WildcardType wildcardName, java.util.Map<java.lang.reflect.Type,TypeVariableName> map)
static TypeName
get(javax.lang.model.type.WildcardType mirror)
(package private) static TypeName
get(javax.lang.model.type.WildcardType mirror, java.util.Map<javax.lang.model.element.TypeParameterElement,TypeVariableName> typeVariables)
static WildcardTypeName
subtypeOf(TypeName upperBound)
Returns a type that represents an unknown type that extendsbound
.static WildcardTypeName
subtypeOf(java.lang.reflect.Type upperBound)
static WildcardTypeName
supertypeOf(TypeName lowerBound)
Returns a type that represents an unknown supertype ofbound
.static WildcardTypeName
supertypeOf(java.lang.reflect.Type lowerBound)
TypeName
withoutAnnotations()
-
Methods inherited from class com.squareup.javapoet.TypeName
annotated, arrayComponent, box, concatAnnotations, emitAnnotations, equals, get, get, get, get, hashCode, isAnnotated, isBoxedPrimitive, isPrimitive, list, list, toString, unbox
-
-
-
-
Constructor Detail
-
WildcardTypeName
private WildcardTypeName(java.util.List<TypeName> upperBounds, java.util.List<TypeName> lowerBounds)
-
WildcardTypeName
private WildcardTypeName(java.util.List<TypeName> upperBounds, java.util.List<TypeName> lowerBounds, java.util.List<AnnotationSpec> annotations)
-
-
Method Detail
-
annotated
public WildcardTypeName annotated(java.util.List<AnnotationSpec> annotations)
-
withoutAnnotations
public TypeName withoutAnnotations()
- Overrides:
withoutAnnotations
in classTypeName
-
emit
CodeWriter emit(CodeWriter out) throws java.io.IOException
-
subtypeOf
public static WildcardTypeName subtypeOf(TypeName upperBound)
Returns a type that represents an unknown type that extendsbound
. For example, ifbound
isCharSequence.class
, this returns? extends CharSequence
. Ifbound
isObject.class
, this returns?
, which is shorthand for? extends Object
.
-
subtypeOf
public static WildcardTypeName subtypeOf(java.lang.reflect.Type upperBound)
-
supertypeOf
public static WildcardTypeName supertypeOf(TypeName lowerBound)
Returns a type that represents an unknown supertype ofbound
. For example, ifbound
isString.class
, this returns? super String
.
-
supertypeOf
public static WildcardTypeName supertypeOf(java.lang.reflect.Type lowerBound)
-
get
public static TypeName get(javax.lang.model.type.WildcardType mirror)
-
get
static TypeName get(javax.lang.model.type.WildcardType mirror, java.util.Map<javax.lang.model.element.TypeParameterElement,TypeVariableName> typeVariables)
-
get
public static TypeName get(java.lang.reflect.WildcardType wildcardName)
-
get
static TypeName get(java.lang.reflect.WildcardType wildcardName, java.util.Map<java.lang.reflect.Type,TypeVariableName> map)
-
-