com.streambase.sb.unittest

## Interface TupleComparator

- All Known Implementing Classes:
    FieldBasedTupleComparator

      public interface TupleComparator

  A `TupleComparator` abstracts comparison of tuples.
  Since:
    6.6

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `compare(Tuple expected, Tuple actual)` Compare two tuples.
    `boolean` | `compareValues(CompleteDataType cdt, Object expected, Object actual)` Compare two values with `CompleteDataType` cdt.
    `String` | `formatForErrorMessage(Tuple t)` Convert the provided Tuple into a string appropriate for error messages.

- - ### Method Detail

    - #### 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`

    - #### 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`

    - #### 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.

Copyright © 2015–2018 Cloud Software Group, Inc.. All rights reserved.