getFundamentalTypeDimension#
int getFundamentalTypeDimension(FundamentalType fun)
Gets the dimensionality of a FundamentalType.
Returns the number of dimensions for collection types:
- Returns
0for non-collection (singular) types - Returns
1for one-dimensional collections (arrays, lists) - Returns
2for two-dimensional collections (arrays of arrays) - Returns
3for three-dimensional collections
This implementation relies on the specific ordering of values in the FundamentalType enumeration, where collection types are grouped by their dimensionality.
Example:
getFundamentalTypeDimension(FundamentalType.STRING); // 0
getFundamentalTypeDimension(FundamentalType.STRINGS); // 1
getFundamentalTypeDimension(FundamentalType.STRINGS2); // 2
getFundamentalTypeDimension(FundamentalType.STRINGS3); // 3
