public class GenericArrayTypeProperties extends Object implements ArrayTypeProperties
Examples:
Type stringList = new TypeReference<List<String>>() { }.getType();
GenericArrayType stringListArray = (GenericArrayType) new TypeReference<List<String>[][]>() { }.getType();
GenericArrayTypeProperties arrayProps = new GenericArrayTypeProperties(stringListArray);
// arrayProps = new GenericArrayTypeProperties(stringList, 2)| Constructor and Description |
|---|
GenericArrayTypeProperties(GenericArrayType genericArrayType)
Constructor: creates an instance based on the properties of the given array type.
|
GenericArrayTypeProperties(Type componentType,
int dimension)
Constructor for manual creation.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
Type |
getComponentType()
Returns the component of the array.
|
int |
getDimension()
Returns the dimension of the array type.
|
int |
hashCode() |
String |
toString() |
public GenericArrayTypeProperties(GenericArrayType genericArrayType)
genericArrayType - the generic array type to describepublic GenericArrayTypeProperties(Type componentType, int dimension)
componentType - the component typedimension - the dimensionpublic Type getComponentType()
ArrayTypePropertiesgetComponentType in interface ArrayTypePropertiespublic int getDimension()
ArrayTypePropertiesString[]; for double[][][], the dimension is 3. If the processed type is not an array, the
method returns 0.getDimension in interface ArrayTypePropertiesCopyright © 2023. All rights reserved.