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.
|
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.
|
annotations, asClassType, asParameterizedType, asPrimitiveType, asTypeVariable, asUnresolvedTypeVariable, asVoidType, asWildcardType, create
public 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 © 2018 JBoss by Red Hat. All rights reserved.