- 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
public class TypesNotComparableException extends DRException
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
FieldTypesNotComparableException
as 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:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description TypesNotComparableException(RecordTokenType leftType, RecordTokenType rightType, FieldTypesNotComparableException cause)
Constructs aTypesNotComparableException
indicating the specified record types are not comparable due to underlying fields not being comparable.TypesNotComparableException(TokenType leftType, TokenType rightType)
Constructs aTypesNotComparableException
indicating the specified types were compared.TypesNotComparableException(TokenType leftType, TokenType rightType, String reason)
Constructs aTypesNotComparableException
indicating the specified types were compared, providing additional information about the failure.TypesNotComparableException(String context, TypesNotComparableException cause)
Constructs aTypesNotComparableException
providing additional context
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TokenType
getLeftType()
Gets the type of the object on the left side of the comparison which raised this exception.String
getMessage()
TokenType
getRightType()
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 Detail
-
TypesNotComparableException
public TypesNotComparableException(TokenType leftType, TokenType rightType)
Constructs aTypesNotComparableException
indicating 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
public TypesNotComparableException(TokenType leftType, TokenType rightType, String reason)
Constructs aTypesNotComparableException
indicating 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 aTypesNotComparableException
indicating 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
public TypesNotComparableException(String context, TypesNotComparableException cause)
Constructs aTypesNotComparableException
providing additional context- Parameters:
context
- a message providing additional context for the exceptioncause
- the wrapped exception
-
-
Method Detail
-
getMessage
public String getMessage()
- Overrides:
getMessage
in classThrowable
-
getLeftType
public TokenType 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
public TokenType 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
-
-