Interface Filter
- All Superinterfaces:
Transformer
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
View transformer which filters out entries which don't belong. Implementations only need to
implement the
isAllowed method.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault byte[]inverseTransformValue(byte[] tvalue, byte[] key, byte[] tkey) Calls theisAllowedmethod.booleanisAllowed(byte[] key, byte[] value) Return true if the given key and value are not to be filtered out.default byte[]transformValue(byte[] value, byte[] key, byte[] tkey) Calls theisAllowedmethod.Methods inherited from interface Transformer
inverseTransformKey, inverseTransformKeyGt, inverseTransformKeyLt, requireValue, transformedComparator, transformedOrdering, transformKey, transformValueModifier and TypeMethodDescriptiondefault byte[]inverseTransformKey(byte[] tkey) Apply an inverse transformation of the given key, if supported.default byte[]inverseTransformKeyGt(byte[] tkey) Apply an inverse transformation of the given key, strictly greater than the one given.default byte[]inverseTransformKeyLt(byte[] tkey) Apply an inverse transformation of the given key, strictly less than the one given.default BooleanReturns true by default, indicating that the transform methods always require a value instance to be provided.default Comparator<byte[]> transformedComparator(Comparator<byte[]> original) Returns the view comparator, after transformation.default OrderingtransformedOrdering(Ordering original) Returns the natural ordering of keys, after they have been transformed.default byte[]transformKey(Cursor cursor) Transform or filter out the given key.default byte[]transformValue(Cursor cursor, byte[] tkey) Transform or filter out the given value.
-
Method Details
-
isAllowed
Return true if the given key and value are not to be filtered out.- Throws:
IOException
-
transformValue
Calls theisAllowedmethod.- Specified by:
transformValuein interfaceTransformer- Parameters:
value- nullable value to transformkey- non-null untransformed key associated with the valuetkey- non-null transformed key associated with the value- Returns:
- transformed value or null to discard entry
- Throws:
IOException
-
inverseTransformValue
default byte[] inverseTransformValue(byte[] tvalue, byte[] key, byte[] tkey) throws IOException, ViewConstraintException Calls theisAllowedmethod.- Specified by:
inverseTransformValuein interfaceTransformer- Parameters:
tvalue- nullable value to transformkey- non-null untransformed key associated with the valuetkey- non-null transformed key associated with the value- Returns:
- inverse transformed value, or null to delete the value
- Throws:
ViewConstraintException- if inverse transformation of given value is not supportedIOException
-