public final class ArrayType extends Type
EMPTY_ARRAY
Modifier and Type | Method and Description |
---|---|
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.
|
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, 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.
|
String |
toString()
Returns a string representation for this type.
|
annotation, annotations, asClassType, asParameterizedType, asPrimitiveType, asTypeVariable, asUnresolvedTypeVariable, asVoidType, asWildcardType, create, hasAnnotation
public 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
public DotName name()
Type
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 String toString()
Type
public int dimensions()
String[][]
, would return a value
of 2.public ArrayType asArrayType()
Type
ArrayType
and returns it if the kind is
Type.Kind.ARRAY
Throws an exception otherwise.asArrayType
in class Type
ClassType
public boolean equals(Object o)
Type
equals
in class Type
o
- the type to compare toObject.equals(Object)
Copyright © 2020 JBoss by Red Hat. All rights reserved.