Class ValueConversionException
java.lang.Object
java.lang.Throwable
java.lang.Exception
com.soklet.converter.ValueConversionException
- All Implemented Interfaces:
Serializable
Thrown if an error occurs during value conversion.
For example, a ValueConverter
for 'from' type String
and 'to' type Integer
might throw this exception if the 'from' value is "abc"
.
- Author:
- Mark Allen
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionValueConversionException
(String message, Type fromType, Object fromValue, Type toType) Creates an exception that describes the value conversion error.ValueConversionException
(String message, Throwable cause, Type fromType, Object fromValue, Type toType) Creates an exception that describes the value conversion error.ValueConversionException
(Throwable cause, Type fromType, Object fromValue, Type toType) Creates an exception that describes the value conversion error. -
Method Summary
Modifier and TypeMethodDescriptionThe 'from' type of the failedValueConverter
.The 'from' value of the failedValueConverter
.The 'to' type of the failedValueConverter
.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
ValueConversionException
public ValueConversionException(@Nullable String message, @Nonnull Type fromType, @Nullable Object fromValue, @Nonnull Type toType) Creates an exception that describes the value conversion error.- Parameters:
message
- a message describing the errorfromType
- the 'from' typefromValue
- the value supplied for the 'from' typetoType
- the 'to' type
-
ValueConversionException
public ValueConversionException(@Nullable Throwable cause, @Nonnull Type fromType, @Nullable Object fromValue, @Nonnull Type toType) Creates an exception that describes the value conversion error.- Parameters:
cause
- the underlying exception that caused this one to be thrownfromType
- the 'from' typefromValue
- the value supplied for the 'from' typetoType
- the 'to' type
-
ValueConversionException
public ValueConversionException(@Nullable String message, @Nullable Throwable cause, @Nonnull Type fromType, @Nullable Object fromValue, @Nonnull Type toType) Creates an exception that describes the value conversion error.- Parameters:
message
- a message describing the errorcause
- the underlying exception that caused this one to be thrownfromType
- the 'from' typefromValue
- the value supplied for the 'from' typetoType
- the 'to' type
-
-
Method Details
-
getFromType
The 'from' type of the failedValueConverter
.- Returns:
- the 'from' type
-
getFromValue
The 'from' value of the failedValueConverter
.- Returns:
- the 'from' value that could not be converted to the 'to' type
-
getToType
-