Class CsvDataTypeMismatchException

All Implemented Interfaces:
Serializable

public class CsvDataTypeMismatchException extends CsvFieldAssignmentException
This exception should be thrown when the provided string value for conversion cannot be converted to the required type of the destination field.
Since:
3.8
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • sourceObject

      private final transient Object sourceObject
    • destinationClass

      private final Class<?> destinationClass
  • Constructor Details

    • CsvDataTypeMismatchException

      public CsvDataTypeMismatchException()
      Default constructor, in case no further information is necessary or available.
    • CsvDataTypeMismatchException

      public CsvDataTypeMismatchException(Object sourceObject, Class<?> destinationClass)
      Constructor for setting the data and the class of the intended destination field.
      Parameters:
      sourceObject - Object that was to be assigned to the destination field. This may not be available in all contexts.
      destinationClass - Class of the destination field. This may not be available in all contexts.
    • CsvDataTypeMismatchException

      public CsvDataTypeMismatchException(String message)
      Constructor with a simple text.
      Parameters:
      message - Human-readable error text
    • CsvDataTypeMismatchException

      public CsvDataTypeMismatchException(Object sourceObject, Class<?> destinationClass, String message)
      Constructor for setting the data and the class of the intended destination field along with an error message.
      Parameters:
      sourceObject - Object that was to be assigned to the destination field. This may not be available in all contexts.
      destinationClass - Class of the destination field. This may not be available in all contexts.
      message - Human-readable error text
  • Method Details

    • getSourceObject

      public Object getSourceObject()
      Gets the object that was to be assigned to a field of the wrong type. sourceObject is marked transient, because Object is not Serializable. If for any reason this exception is serialized and deserialized, this method will subsequently return null.
      Returns:
      The data that could not be assigned
    • getDestinationClass

      public Class<?> getDestinationClass()
      Gets the type of the field to which the data were to be assigned.
      Returns:
      The class of the destination field