Package org.infinispan.objectfilter
Interface FilterCallback
-
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface FilterCallback
A single-method callback that is specified when registering a filter with a Matcher. TheonFilterResult(java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object[], java.lang.Comparable[])
method is notified of all instances that were presented toMatcher.match(java.lang.Object, java.lang.Object, java.lang.Object)
and successfully matched the filter associated with this callback. The callback will receive the instance being matched, the projected fields (optional, if specified) and the 'order by' projections (optional, if specified). The 'order by' projection is an array ofComparable
that can be compared using theComparator
provided byFilterSubscription.getComparator()
. Implementations of this interface are provided by the subscriber and must written is such a way that they can be invoked from multiple threads simultaneously.- Since:
- 7.0
- Author:
- anistor@redhat.com
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
onFilterResult(Object userContext, Object eventType, Object instance, Object[] projection, Comparable[] sortProjection)
Receives notification that an instance matches the filter.
-
-
-
Method Detail
-
onFilterResult
void onFilterResult(Object userContext, Object eventType, Object instance, Object[] projection, Comparable[] sortProjection)
Receives notification that an instance matches the filter.- Parameters:
userContext
- the optional user context object passed toMatcher.match(java.lang.Object, java.lang.Object, java.lang.Object)
eventType
- the optional event type discriminator object passed toMatcher.match(java.lang.Object, java.lang.Object, java.lang.Object)
instance
- the object being matchedprojection
- the projection, if a projection was requested ornull
otherwisesortProjection
- the projection of fields used for sorting, if sorting was requested ornull
otherwise
-
-