Class TypeConversionHelper

  • public class TypeConversionHelper
    extends Object
    Class with methods for type conversion.
    • Constructor Detail

      • TypeConversionHelper

        public TypeConversionHelper()
    • Method Detail

      • convertTo

        public static Object convertTo​(Object value,
                                       Class type)
        Convert the value to a instance of the given type. The value is converted only if the type can't be assigned from the current type of the value instance.
        value - the value to be converted
        type - the type of the expected object returned from the conversion
        the converted object, or the input value if the object can't be converted