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. The onFilterResult(java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object[], java.lang.Comparable[]) method is notified of all instances that were presented to Matcher.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 of Comparable that can be compared using the Comparator provided by FilterSubscription.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​(java.lang.Object userContext, java.lang.Object eventType, java.lang.Object instance, java.lang.Object[] projection, java.lang.Comparable[] sortProjection)
      Receives notification that an instance matches the filter.
    • Method Detail

      • onFilterResult

        void onFilterResult​(java.lang.Object userContext,
                            java.lang.Object eventType,
                            java.lang.Object instance,
                            java.lang.Object[] projection,
                            java.lang.Comparable[] sortProjection)
        Receives notification that an instance matches the filter.
        Parameters:
        userContext - the optional user context object passed to Matcher.match(java.lang.Object, java.lang.Object, java.lang.Object)
        eventType - the optional event type discriminator object passed to Matcher.match(java.lang.Object, java.lang.Object, java.lang.Object)
        instance - the object being matched
        projection - the projection, if a projection was requested or null otherwise
        sortProjection - the projection of fields used for sorting, if sorting was requested or null otherwise