Class ComparatorFilter
java.lang.Object
com.invirgance.convirgance.transform.filter.ComparatorFilter
- All Implemented Interfaces:
Filter,Transformer,Predicate<JSONObject>
- Direct Known Subclasses:
EqualsFilter,GreaterThanFilter,GreaterThanOrEqualFilter,LessThanFilter,LessThanOrEqualFilter
Filters data by comparing a specified key-value pair using a flexible coercive comparator.
- Author:
- jbanes
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new ComparatorFilter.ComparatorFilter(String key, Object value) Creates a ComparatorFilter to use with a provided key and value. -
Method Summary
Modifier and TypeMethodDescriptionprotected CoerciveComparatorReturns theCoerciveComparatorused for filtering.getKey()Gets the comparison key in use.getValue()Gets the expected value for the key.voidSet the comparison key.voidSets the value to use for comparison on the provided key.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.invirgance.convirgance.transform.Transformer
transform
-
Constructor Details
-
ComparatorFilter
public ComparatorFilter()Creates a new ComparatorFilter. -
ComparatorFilter
Creates a ComparatorFilter to use with a provided key and value.- Parameters:
key- The key to compare.value- The key's value.
-
-
Method Details
-
getComparator
Returns theCoerciveComparatorused for filtering.- Returns:
- The CoerciveComparator.
-
getKey
Gets the comparison key in use.- Returns:
- The key.
-
setKey
Set the comparison key.- Parameters:
key- The key.
-
getValue
Gets the expected value for the key.- Returns:
- The value.
-
setValue
Sets the value to use for comparison on the provided key.- Parameters:
value- The comparison value.
-