public final class ArrayType extends Type
| Modifier and Type | Field and Description |
|---|---|
private Type |
component |
private int |
dimensions |
private int |
hash |
EMPTY_ARRAY| Constructor and Description |
|---|
ArrayType(Type component,
int dimensions) |
ArrayType(Type component,
int dimensions,
AnnotationInstance[] annotations) |
| Modifier and Type | Method and Description |
|---|---|
private void |
appendArraySyntax(java.lang.StringBuilder builder) |
private void |
appendRootComponent(java.lang.StringBuilder builder) |
ArrayType |
asArrayType()
Casts this type to an
ArrayType and returns it if the kind is
Type.Kind.ARRAY
Throws an exception otherwise. |
Type |
component()
Returns the component type of the array.
|
(package private) Type |
copyType(AnnotationInstance[] newAnnotations) |
(package private) Type |
copyType(Type component,
int dimensions) |
int |
dimensions()
The number of dimensions this array type has.
|
boolean |
equals(java.lang.Object o)
Compares this Type with another type, and returns true if they are equivalent.
|
int |
hashCode()
Computes a hash code representing this type.
|
Type.Kind |
kind()
Returns the kind of Type this is.
|
DotName |
name()
Returns the raw name of this type.
|
java.lang.String |
toString()
Returns a string representation for this type.
|
addAnnotation, annotationArray, annotations, appendAnnotations, asClassType, asParameterizedType, asPrimitiveType, asTypeVariable, asUnresolvedTypeVariable, asVoidType, asWildcardType, create, toStringprivate final Type component
private final int dimensions
private int hash
ArrayType(Type component, int dimensions)
ArrayType(Type component, int dimensions, AnnotationInstance[] annotations)
public Type component()
String[]
has a component type of Stringpublic DotName name()
TypeDotName.
Generic values are returned as the underlying raw value. For example,
a wildcard such as ? extends Number, has a raw type of
Number
public java.lang.String toString()
Typeprivate void appendRootComponent(java.lang.StringBuilder builder)
private void appendArraySyntax(java.lang.StringBuilder builder)
public int dimensions()
String[][], would return a value
of 2.public ArrayType asArrayType()
TypeArrayType and returns it if the kind is
Type.Kind.ARRAY
Throws an exception otherwise.asArrayType in class TypeClassTypepublic boolean equals(java.lang.Object o)
Typepublic int hashCode()
TypeType copyType(AnnotationInstance[] newAnnotations)