Modifier and Type | Class | Description |
---|---|---|
class |
ArrayTypeName |
|
class |
ClassName |
A fully-qualified class name for top-level and member classes.
|
class |
ParameterizedTypeName |
|
class |
TypeVariableName |
|
class |
WildcardTypeName |
Modifier and Type | Field | Description |
---|---|---|
static TypeName |
TypeName.BOOLEAN |
|
static TypeName |
TypeName.BYTE |
|
static TypeName |
TypeName.CHAR |
|
TypeName |
ArrayTypeName.componentType |
|
static TypeName |
TypeName.DOUBLE |
|
static TypeName |
TypeName.FLOAT |
|
static TypeName |
TypeName.INT |
|
static TypeName |
TypeName.LONG |
|
TypeName |
MethodSpec.returnType |
|
static TypeName |
TypeName.SHORT |
|
TypeName |
TypeSpec.superclass |
|
TypeName |
AnnotationSpec.type |
|
TypeName |
FieldSpec.type |
|
TypeName |
ParameterSpec.type |
|
static TypeName |
TypeName.VOID |
Modifier and Type | Field | Description |
---|---|---|
List<TypeName> |
TypeVariableName.bounds |
|
List<TypeName> |
MethodSpec.exceptions |
|
List<TypeName> |
WildcardTypeName.lowerBounds |
|
List<TypeName> |
TypeSpec.superinterfaces |
|
List<TypeName> |
ParameterizedTypeName.typeArguments |
|
List<TypeName> |
WildcardTypeName.upperBounds |
Modifier and Type | Method | Description |
---|---|---|
TypeName |
TypeName.annotated(AnnotationSpec... annotations) |
|
TypeName |
TypeName.annotated(List<AnnotationSpec> annotations) |
|
TypeName |
TypeName.box() |
Returns a boxed type if this is a primitive type (like
Integer for int ) or
void . |
static TypeName |
TypeName.get(Type type) |
Returns a type name equivalent to
type . |
static TypeName |
TypeName.get(TypeMirror mirror) |
Returns a type name equivalent to
mirror . |
static TypeName |
WildcardTypeName.get(WildcardType wildcardName) |
|
static TypeName |
WildcardTypeName.get(WildcardType mirror) |
|
TypeName |
TypeName.unbox() |
Returns an unboxed type if this is a boxed primitive type (like
int for
Integer ) or Void . |
TypeName |
ArrayTypeName.withoutAnnotations() |
|
TypeName |
ClassName.withoutAnnotations() |
|
TypeName |
ParameterizedTypeName.withoutAnnotations() |
|
TypeName |
TypeName.withoutAnnotations() |
|
TypeName |
TypeVariableName.withoutAnnotations() |
|
TypeName |
WildcardTypeName.withoutAnnotations() |
Modifier and Type | Method | Description |
---|---|---|
MethodSpec.Builder |
MethodSpec.Builder.addException(TypeName exception) |
|
TypeSpec.Builder |
TypeSpec.Builder.addField(TypeName type,
String name,
Modifier... modifiers) |
|
MethodSpec.Builder |
MethodSpec.Builder.addParameter(TypeName type,
String name,
Modifier... modifiers) |
|
TypeSpec.Builder |
TypeSpec.Builder.addSuperinterface(TypeName superinterface) |
|
static FieldSpec.Builder |
FieldSpec.builder(TypeName type,
String name,
Modifier... modifiers) |
|
static ParameterSpec.Builder |
ParameterSpec.builder(TypeName type,
String name,
Modifier... modifiers) |
|
static ParameterizedTypeName |
ParameterizedTypeName.get(ClassName rawType,
TypeName... typeArguments) |
Returns a parameterized type, applying
typeArguments to rawType . |
static TypeVariableName |
TypeVariableName.get(String name,
TypeName... bounds) |
Returns type variable named
name with bounds . |
static ArrayTypeName |
ArrayTypeName.of(TypeName componentType) |
Returns an array type whose elements are all instances of
componentType . |
MethodSpec.Builder |
MethodSpec.Builder.returns(TypeName returnType) |
|
static WildcardTypeName |
WildcardTypeName.subtypeOf(TypeName upperBound) |
Returns a type that represents an unknown type that extends
bound . |
TypeSpec.Builder |
TypeSpec.Builder.superclass(TypeName superclass) |
|
static WildcardTypeName |
WildcardTypeName.supertypeOf(TypeName lowerBound) |
Returns a type that represents an unknown supertype of
bound . |
TypeVariableName |
TypeVariableName.withBounds(TypeName... bounds) |
Modifier and Type | Method | Description |
---|---|---|
MethodSpec.Builder |
MethodSpec.Builder.addExceptions(Iterable<? extends TypeName> exceptions) |
|
TypeSpec.Builder |
TypeSpec.Builder.addSuperinterfaces(Iterable<? extends TypeName> superinterfaces) |
|
ParameterizedTypeName |
ParameterizedTypeName.nestedClass(String name,
List<TypeName> typeArguments) |
Returns a new
ParameterizedTypeName instance for the specified name as nested
inside this class, with the specified typeArguments . |
TypeVariableName |
TypeVariableName.withBounds(List<TypeName> bounds) |
Copyright © 2019 Square, Inc.. All rights reserved.