Class TypeConverter

java.lang.Object
com.flowlogix.util.TypeConverter

public class TypeConverter extends Object
Converts from any String to any type dynamically, using static valueOf(String input) method of the target type, or other methods with equivalent functionality

Accepts database special values, such as inf, -inf, and nan

Examples:

int one = TypeConverter.valueOf("1", int.class);
TT convertedValue = TypeConverter.valueOf(input, cls);
CheckedValue<TT> checkedValue = TypeConverter.checkAndConvert(input, cls);
if (checkedValue.isValid()) {
    // get and operate on a value in a type-safe way
    TT value = checkedValue.getValue();
}
Author:
lprimak