public final class ArrayType extends Type
EMPTY_ARRAY| Modifier and Type | Method and Description |
|---|---|
static boolean |
arrayEquals(org.jboss.jandex.Interned[] a,
org.jboss.jandex.Interned[] b) |
static int |
arrayHashCode(org.jboss.jandex.Interned[] array) |
ArrayType |
asArrayType()
Casts this type to an
ArrayType and returns it if the kind is
Type.Kind.ARRAY. |
Type |
component()
Returns the component type of the array.
|
static ArrayType |
create(Type component,
int dimensions)
Create a new mock array type instance with the specified component
and dimensions.
|
int |
dimensions()
The number of dimensions this array type has.
|
boolean |
equals(Object o)
Compares this
Type with another type. |
int |
hashCode()
Computes a hash code representing this type.
|
boolean |
internEquals(Object o) |
int |
internHashCode() |
Type.Kind |
kind()
Returns the kind of Type this is.
|
DotName |
name()
Returns the raw name of this type.
|
annotation, annotations, annotationsWithRepeatable, asClassType, asParameterizedType, asPrimitiveType, asTypeVariable, asTypeVariableReference, asUnresolvedTypeVariable, asVoidType, asWildcardType, create, createWithAnnotations, hasAnnotation, toStringpublic static ArrayType create(Type component, int dimensions)
component - the array componentdimensions - the number of dimensions of this arraypublic Type component()
String[] has
a component type of String.
It is possible for an ArrayType to have another ArrayType
as its component type. This happens when an array has some of its dimensions
annotated (e.g. String[] @Ann []). In such case, having multiple nested
ArrayTypes is necessary to faithfully represent the annotations.
public DotName name()
Type[[[Ljava.lang.String;) Classes are returned as a normal DotName.
Generic values are returned as the underlying raw value. For example,
a wildcard such as ? extends Number has a raw type of
Number.
public int dimensions()
String[][].
Note that an ArrayType may have another ArrayType as its component type
(see component()). For example, String[] @Ann [] is an array type
with 1 dimension and a component type of another array type, also with 1 dimension.
public ArrayType asArrayType()
TypeArrayType and returns it if the kind is
Type.Kind.ARRAY. Throws an exception otherwise.asArrayType in class TypeArrayTypepublic boolean equals(Object o)
TypeType with another type. A type is equal to another type
if it is of the same kind, and all of their fields are equal. This includes
annotations, which must be equal as well.equals in class Typeo - the type to compare toObject.equals(Object)public int hashCode()
Typepublic boolean internEquals(Object o)
internEquals in class Typepublic int internHashCode()
internHashCode in class Typepublic static boolean arrayEquals(org.jboss.jandex.Interned[] a,
org.jboss.jandex.Interned[] b)
public static int arrayHashCode(org.jboss.jandex.Interned[] array)
Copyright © 2018–2022. All rights reserved.