Class ConditionalSetBiValueComparer<T>
java.lang.Object
org.dbunit.assertion.comparer.value.ValueComparerBase
org.dbunit.assertion.comparer.value.ConditionalSetBiValueComparer<T>
- Type Parameters:
T- The type of the value used to determine whichValueComparerto use.
- All Implemented Interfaces:
ValueComparer
Use one of two
ValueComparers based on a value present or not in a
set of values.
When the value returned by the
actualValueFactory is in
values, use the
inValuesValueComparer on the row;
otherwise, use the
notInValuesValueComparer on the row.- Since:
- 2.6.0
- Author:
- Jeff Jensen
-
Field Summary
Fields inherited from class org.dbunit.assertion.comparer.value.ValueComparerBase
BASE_FAIL_MSG -
Constructor Summary
ConstructorsConstructorDescriptionConditionalSetBiValueComparer(ValueFactory<T> actualValueFactory, Set<T> values, ValueComparer inValuesValueComparer, ValueComparer notInValuesValueComparer) -
Method Summary
Modifier and TypeMethodDescriptiondoCompare(ITable expectedTable, ITable actualTable, int rowNum, String columnName, DataType dataType, Object expectedValue, Object actualValue) Do the comparison and return a fail message or null if comparison passes.protected booleanisActualValueInValues(ITable actualTable, int rowNum) toString()Methods inherited from class org.dbunit.assertion.comparer.value.ValueComparerBase
compare
-
Constructor Details
-
ConditionalSetBiValueComparer
public ConditionalSetBiValueComparer(ValueFactory<T> actualValueFactory, Set<T> values, ValueComparer inValuesValueComparer, ValueComparer notInValuesValueComparer) - Parameters:
actualValueFactory- Factory to make the value to lookup in the values list.values- List of values that mean to use the inValuesValueComparer.inValuesValueComparer- TheValueComparerused when the value from the actualValueFactory is in the values map.notInValuesValueComparer- TheValueComparerused when the value from the actualValueFactory is not in the values map.
-
-
Method Details
-
doCompare
public String doCompare(ITable expectedTable, ITable actualTable, int rowNum, String columnName, DataType dataType, Object expectedValue, Object actualValue) throws DatabaseUnitException Description copied from class:ValueComparerBaseDo the comparison and return a fail message or null if comparison passes.- Specified by:
doComparein classValueComparerBase- Throws:
DatabaseUnitException- See Also:
-
isActualValueInValues
- Throws:
DataSetException
-
toString
- Overrides:
toStringin classValueComparerBase
-