Package com.squareup.javapoet
Class ParameterizedTypeName
- java.lang.Object
-
- com.squareup.javapoet.TypeName
-
- com.squareup.javapoet.ParameterizedTypeName
-
public final class ParameterizedTypeName extends TypeName
-
-
Field Summary
Fields Modifier and Type Field Description private ParameterizedTypeName
enclosingType
ClassName
rawType
java.util.List<TypeName>
typeArguments
-
Constructor Summary
Constructors Modifier Constructor Description (package private)
ParameterizedTypeName(ParameterizedTypeName enclosingType, ClassName rawType, java.util.List<TypeName> typeArguments)
private
ParameterizedTypeName(ParameterizedTypeName enclosingType, ClassName rawType, java.util.List<TypeName> typeArguments, java.util.List<AnnotationSpec> annotations)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ParameterizedTypeName
annotated(java.util.List<AnnotationSpec> annotations)
(package private) CodeWriter
emit(CodeWriter out)
static ParameterizedTypeName
get(ClassName rawType, TypeName... typeArguments)
Returns a parameterized type, applyingtypeArguments
torawType
.static ParameterizedTypeName
get(java.lang.Class<?> rawType, java.lang.reflect.Type... typeArguments)
Returns a parameterized type, applyingtypeArguments
torawType
.static ParameterizedTypeName
get(java.lang.reflect.ParameterizedType type)
Returns a parameterized type equivalent totype
.(package private) static ParameterizedTypeName
get(java.lang.reflect.ParameterizedType type, java.util.Map<java.lang.reflect.Type,TypeVariableName> map)
Returns a parameterized type equivalent totype
.ParameterizedTypeName
nestedClass(java.lang.String name)
Returns a newParameterizedTypeName
instance for the specifiedname
as nested inside this class.ParameterizedTypeName
nestedClass(java.lang.String name, java.util.List<TypeName> typeArguments)
Returns a newParameterizedTypeName
instance for the specifiedname
as nested inside this class, with the specifiedtypeArguments
.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
-
-
-
-
Field Detail
-
enclosingType
private final ParameterizedTypeName enclosingType
-
rawType
public final ClassName rawType
-
typeArguments
public final java.util.List<TypeName> typeArguments
-
-
Constructor Detail
-
ParameterizedTypeName
ParameterizedTypeName(ParameterizedTypeName enclosingType, ClassName rawType, java.util.List<TypeName> typeArguments)
-
ParameterizedTypeName
private ParameterizedTypeName(ParameterizedTypeName enclosingType, ClassName rawType, java.util.List<TypeName> typeArguments, java.util.List<AnnotationSpec> annotations)
-
-
Method Detail
-
annotated
public ParameterizedTypeName annotated(java.util.List<AnnotationSpec> annotations)
-
withoutAnnotations
public TypeName withoutAnnotations()
- Overrides:
withoutAnnotations
in classTypeName
-
emit
CodeWriter emit(CodeWriter out) throws java.io.IOException
-
nestedClass
public ParameterizedTypeName nestedClass(java.lang.String name)
Returns a newParameterizedTypeName
instance for the specifiedname
as nested inside this class.
-
nestedClass
public ParameterizedTypeName nestedClass(java.lang.String name, java.util.List<TypeName> typeArguments)
Returns a newParameterizedTypeName
instance for the specifiedname
as nested inside this class, with the specifiedtypeArguments
.
-
get
public static ParameterizedTypeName get(ClassName rawType, TypeName... typeArguments)
Returns a parameterized type, applyingtypeArguments
torawType
.
-
get
public static ParameterizedTypeName get(java.lang.Class<?> rawType, java.lang.reflect.Type... typeArguments)
Returns a parameterized type, applyingtypeArguments
torawType
.
-
get
public static ParameterizedTypeName get(java.lang.reflect.ParameterizedType type)
Returns a parameterized type equivalent totype
.
-
get
static ParameterizedTypeName get(java.lang.reflect.ParameterizedType type, java.util.Map<java.lang.reflect.Type,TypeVariableName> map)
Returns a parameterized type equivalent totype
.
-
-