Interface TupleComparator

All Known Implementing Classes:
FieldBasedTupleComparator

public interface TupleComparator
A TupleComparator abstracts comparison of tuples.
Since:
6.6
  • Method Details

    • compare

      boolean compare(Tuple expected, Tuple actual) throws StreamBaseException
      Compare two tuples.
      Parameters:
      expected - The expected value
      actual - The actual value
      Returns:
      true if the tuples are equal
      Throws:
      StreamBaseException - error comparing tuples
    • compareValues

      boolean compareValues(CompleteDataType cdt, Object expected, Object actual) throws StreamBaseException
      Compare two values with CompleteDataType cdt.
      Parameters:
      cdt - The CompleteDataType for the objects being compared
      expected - The expected value
      actual - The actual value
      Returns:
      true if the values are equal
      Throws:
      StreamBaseException - error comparing tuples
    • formatForErrorMessage

      String formatForErrorMessage(Tuple t)
      Convert the provided Tuple into a string appropriate for error messages. Some comparators may wish to omit fields that are not salient to the comparison.
      Parameters:
      t - The tuple to format
      Returns:
      A human readable string.