Interface TypeConverter<T>

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      T convert​(java.lang.Object value)
      Converts object received as parameter into object of another class.
      default T convert​(java.lang.Object value, T defaultValue)
      Converts object and returns default value if conversion fails.
    • Method Detail

      • convert

        T convert​(java.lang.Object value)
        Converts object received as parameter into object of another class. For example, an Integer converter tries to convert given objects into target Integer object. Converters should try all reasonable ways of conversion into target object, depending on target type.
        Parameters:
        value - object to convert from
        Returns:
        resulting object converted to target type
        Throws:
        TypeConversionException - if conversion fails
      • convert

        default T convert​(java.lang.Object value,
                          T defaultValue)
        Converts object and returns default value if conversion fails.