Package com.streambase.sb.unittest
Class FieldBasedTupleComparator.CompareFunctor
java.lang.Object
com.streambase.sb.unittest.FieldBasedTupleComparator.CompareFunctor
- All Implemented Interfaces:
com.streambase.sb.DataType.Registry.Functor
- Direct Known Subclasses:
FieldBasedTupleComparator.DoubleCompareFunctor
,FieldBasedTupleComparator.IgnoreTimestampCompareFunctor
,FieldBasedTupleComparator.ListCompareFunctor
,FieldBasedTupleComparator.NaiveObjectCompareFunctor
,FieldBasedTupleComparator.RegexCompareFunctor
,FieldBasedTupleComparator.TupleCompareFunctor
- Enclosing class:
- FieldBasedTupleComparator
public abstract static class FieldBasedTupleComparator.CompareFunctor
extends Object
implements com.streambase.sb.DataType.Registry.Functor
A strategy object for handling comparisons of specific field types.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
compare
(TupleComparator comparator, CompleteDataType cdt, Object expected, Object actual) Handle null checks before delegating tocompareImpl(com.streambase.sb.unittest.TupleComparator, com.streambase.sb.CompleteDataType, java.lang.Object, java.lang.Object)
abstract boolean
compareImpl
(TupleComparator comparator, CompleteDataType cdt, Object expected, Object actual) Compare two values expected and actual, usingcomparator
for recursion as necessary.
-
Constructor Details
-
CompareFunctor
public CompareFunctor()
-
-
Method Details
-
compare
public boolean compare(TupleComparator comparator, CompleteDataType cdt, Object expected, Object actual) throws StreamBaseException Handle null checks before delegating tocompareImpl(com.streambase.sb.unittest.TupleComparator, com.streambase.sb.CompleteDataType, java.lang.Object, java.lang.Object)
- Parameters:
comparator
- comparatorcdt
- complete data typeexpected
- expectedactual
- actual- Returns:
- true if equal
- Throws:
StreamBaseException
- error comparing tuples
-
compareImpl
public abstract boolean compareImpl(TupleComparator comparator, CompleteDataType cdt, Object expected, Object actual) throws StreamBaseException Compare two values expected and actual, usingcomparator
for recursion as necessary.- Parameters:
comparator
- recurse through this argument for parameterized types.cdt
- complete data typeexpected
- a non-null objectactual
- a non-null object- Returns:
- true if and only if the values are considered equal
- Throws:
StreamBaseException
- conmparison error
-