public abstract class RowFilter
extends java.lang.Object
apply(Iterable) method to create an Iterable over a
table which returns only rows matching some criteria.| Modifier and Type | Class and Description |
|---|---|
private class |
RowFilter.FilterIterable
Iterable which creates a filtered view of a another row iterable.
|
| Constructor and Description |
|---|
RowFilter() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Iterable<Row> |
apply(java.lang.Iterable<? extends Row> iterable)
Returns an iterable which filters the given iterable based on this
filter.
|
static java.lang.Iterable<Row> |
apply(RowFilter rowFilter,
java.lang.Iterable<? extends Row> iterable)
Returns an iterable which filters the given iterable based on the given
rowFilter.
|
static RowFilter |
invert(RowFilter filter)
Creates a filter which inverts the sense of the given filter (rows which
are matched by the given filter will not be matched by the returned
filter, and vice versa).
|
abstract boolean |
matches(Row row)
Returns
true if the given table row matches the Filter criteria,
false otherwise. |
static RowFilter |
matchPattern(Column columnPattern,
java.lang.Object valuePattern)
Creates a filter based on a single value row pattern.
|
static RowFilter |
matchPattern(java.util.Map<java.lang.String,?> rowPattern)
Creates a filter based on a row pattern.
|
public abstract boolean matches(Row row)
true if the given table row matches the Filter criteria,
false otherwise.row - current row to test for inclusion in the filterpublic java.lang.Iterable<Row> apply(java.lang.Iterable<? extends Row> iterable)
iterable - row iterable to filterpublic static RowFilter matchPattern(java.util.Map<java.lang.String,?> rowPattern)
rowPattern - Map from column names to the values to be matched.
A table row will match the target if
ObjectUtils.equals(rowPattern.get(s), row.get(s))
for all column names in the pattern map.public static RowFilter matchPattern(Column columnPattern, java.lang.Object valuePattern)
columnPattern - column to be matchedvaluePattern - value to be matched.
A table row will match the target if
ObjectUtils.equals(valuePattern, row.get(columnPattern.getName())).public static RowFilter invert(RowFilter filter)
filter - filter which to invertpublic static java.lang.Iterable<Row> apply(RowFilter rowFilter, java.lang.Iterable<? extends Row> iterable)
rowFilter - the filter criteria, may be nulliterable - row iterable to filternull
filter was given)