Package com.squareup.javapoet
Class WildcardTypeName
- java.lang.Object
-
- com.squareup.javapoet.TypeName
-
- com.squareup.javapoet.WildcardTypeName
-
public final class WildcardTypeName extends TypeName
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description WildcardTypeName
annotated(List<AnnotationSpec> annotations)
static TypeName
get(WildcardType wildcardName)
static TypeName
get(WildcardType mirror)
static WildcardTypeName
subtypeOf(TypeName upperBound)
Returns a type that represents an unknown type that extendsbound
.static WildcardTypeName
subtypeOf(Type upperBound)
static WildcardTypeName
supertypeOf(TypeName lowerBound)
Returns a type that represents an unknown supertype ofbound
.static WildcardTypeName
supertypeOf(Type lowerBound)
TypeName
withoutAnnotations()
-
Methods inherited from class com.squareup.javapoet.TypeName
annotated, box, concatAnnotations, equals, get, get, hashCode, isAnnotated, isBoxedPrimitive, isPrimitive, toString, unbox
-
-
-
-
Method Detail
-
annotated
public WildcardTypeName annotated(List<AnnotationSpec> annotations)
-
withoutAnnotations
public TypeName withoutAnnotations()
- Overrides:
withoutAnnotations
in classTypeName
-
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(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(Type lowerBound)
-
get
public static TypeName get(WildcardType mirror)
-
get
public static TypeName get(WildcardType wildcardName)
-
-