java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.pervasive.datarush.exceptions.DRException
com.pervasive.datarush.types.TypesNotComparableException
- All Implemented Interfaces:
Serializable
Unchecked exception thrown when an attempt is made to compare two typed
objects of incompatible types.
Exception chaining is used in two ways to provide additional details about the cause of a comparison error.
- In the case of a record type, the exception may contain a
FieldTypesNotComparableExceptionas the cause indicating which fields raised the error. - Exceptions thrown from operators may contain another
TypesNotComparableException. The wrapping exception contains more contextual information about the comparison performed.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionTypesNotComparableException(RecordTokenType leftType, RecordTokenType rightType, FieldTypesNotComparableException cause) Constructs aTypesNotComparableExceptionindicating the specified record types are not comparable due to underlying fields not being comparable.TypesNotComparableException(TokenType leftType, TokenType rightType) Constructs aTypesNotComparableExceptionindicating the specified types were compared.TypesNotComparableException(TokenType leftType, TokenType rightType, String reason) Constructs aTypesNotComparableExceptionindicating the specified types were compared, providing additional information about the failure.TypesNotComparableException(String context, TypesNotComparableException cause) Constructs aTypesNotComparableExceptionproviding additional context -
Method Summary
Modifier and TypeMethodDescriptionGets the type of the object on the left side of the comparison which raised this exception.Gets the type of the object on the right side of the comparison which raised this exception.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
TypesNotComparableException
Constructs aTypesNotComparableExceptionindicating the specified types were compared.- Parameters:
leftType- the type of the object on the left side of the comparisonrightType- the type of the object on the right side of the comparison
-
TypesNotComparableException
Constructs aTypesNotComparableExceptionindicating the specified types were compared, providing additional information about the failure.- Parameters:
leftType- the type of the object on the left side of the comparisonrightType- the type of the object on the right side of the comparisonreason- an additional explanation of why the types are not comparable
-
TypesNotComparableException
public TypesNotComparableException(RecordTokenType leftType, RecordTokenType rightType, FieldTypesNotComparableException cause) Constructs aTypesNotComparableExceptionindicating the specified record types are not comparable due to underlying fields not being comparable.- Parameters:
leftType- the record type of the object on the left side of the comparisonrightType- the record type of the object on the right side of the comparisoncause- the underlying field exception
-
TypesNotComparableException
Constructs aTypesNotComparableExceptionproviding additional context- Parameters:
context- a message providing additional context for the exceptioncause- the wrapped exception
-
-
Method Details
-
getMessage
- Overrides:
getMessagein classThrowable
-
getLeftType
Gets the type of the object on the left side of the comparison which raised this exception.- Returns:
- the type of object on the left side of the comparison
-
getRightType
Gets the type of the object on the right side of the comparison which raised this exception.- Returns:
- the type of object on the right side of the comparison
-