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 privateWildcardTypeName(java.util.List<TypeName> upperBounds, java.util.List<TypeName> lowerBounds)privateWildcardTypeName(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 WildcardTypeNameannotated(java.util.List<AnnotationSpec> annotations)(package private) CodeWriteremit(CodeWriter out)static TypeNameget(java.lang.reflect.WildcardType wildcardName)(package private) static TypeNameget(java.lang.reflect.WildcardType wildcardName, java.util.Map<java.lang.reflect.Type,TypeVariableName> map)static TypeNameget(javax.lang.model.type.WildcardType mirror)(package private) static TypeNameget(javax.lang.model.type.WildcardType mirror, java.util.Map<javax.lang.model.element.TypeParameterElement,TypeVariableName> typeVariables)static WildcardTypeNamesubtypeOf(TypeName upperBound)Returns a type that represents an unknown type that extendsbound.static WildcardTypeNamesubtypeOf(java.lang.reflect.Type upperBound)static WildcardTypeNamesupertypeOf(TypeName lowerBound)Returns a type that represents an unknown supertype ofbound.static WildcardTypeNamesupertypeOf(java.lang.reflect.Type lowerBound)TypeNamewithoutAnnotations()-
Methods inherited from class com.squareup.javapoet.TypeName
annotated, arrayComponent, asArray, 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:
withoutAnnotationsin 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, ifboundisCharSequence.class, this returns? extends CharSequence. IfboundisObject.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, ifboundisString.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)
-
-