*/
@Override
IType buildType() {
IType type = getTypeDeclaration().getType();
TypeHelper helper = getTypeHelper();
// Integral types: int/Integer, long/Long => the result is a Long
if (helper.isIntegralType(type)) {
return helper.longType();
}
// Floating types: float/Float, double/Double => the result is a Double
if (helper.isFloatingType(type)) {
return helper.doubleType();
}
// BigInteger, the result is the same
IType bigIntegerType = helper.bigInteger();
if (type.equals(bigIntegerType)) {
return bigIntegerType;
}
// BigDecimal, the result is the same
IType bigDecimalType = helper.bigDecimal();
if (type.equals(bigDecimalType)) {
return bigDecimalType;
}
// Anything else is an invalid type
return helper.objectType();
}