Class NoTypeConversionAvailableException

All Implemented Interfaces:
Serializable

public class NoTypeConversionAvailableException extends CamelException
Thrown when the Camel type-converter registry cannot find a converter capable of transforming a given value to the requested target type.

This is the checked variant; for the unchecked exception raised when a converter is found but fails during execution, see TypeConversionException.

See Also:
  • Constructor Details

    • NoTypeConversionAvailableException

      public NoTypeConversionAvailableException(@Nullable Object value, Class<?> type)
      Parameters:
      value - the value for which no type converter was found
      type - the expected target type
    • NoTypeConversionAvailableException

      public NoTypeConversionAvailableException(@Nullable Object value, Class<?> type, Throwable cause)
      Parameters:
      value - the value for which no type converter was found
      type - the expected target type
      cause - the cause of the failure
  • Method Details

    • getValue

      public @Nullable Object getValue()
      Returns the value which could not be converted
    • getToType

      public Class<?> getToType()
      Returns the required to type
    • getFromType

      public @Nullable Class<?> getFromType()
      Returns the required from type. Returns null if the provided value was null.
    • createMessage

      public static String createMessage(@Nullable Object value, Class<?> type)
      Returns an error message for no type converter available.
    • createMessage

      public static String createMessage(@Nullable Object value, Class<?> type, Throwable cause)
      Returns an error message for no type converter available with the cause.