Class InstanceCastException

All Implemented Interfaces:
Serializable

public class InstanceCastException extends ProfileException
Exception used to indicate that an instance could not be converted/cast to the expected type.
Since:
5.0
Author:
O. Kerpershoek
See Also:
  • Constructor Details

    • InstanceCastException

      public InstanceCastException(IEntityInstance instance, String requiredType)
      Constructs the exception with the instance that could not be cast, and the type to which it should have been cast.
      Parameters:
      instance - The instance that could not be cast to the required type.
      requiredType - The type to which the instance should have been cast.
    • InstanceCastException

      public InstanceCastException(String instanceType, String requiredType)
      Constructs the exception with the actual type and the type to which the instance should have been cast.
      Parameters:
      instanceType - The actual type of the instance that could not be cast.
      requiredType - The type to which the instance should have been cast.
  • Method Details

    • getInstanceType

      public String getInstanceType()
      This method returns the actual type of the instance.
      Returns:
      the actual type of the instance.
    • getRequiredType

      public String getRequiredType()
      This method returns the type to which the instance should have been cast.
      Returns:
      the type to which the instance should have been cast.