Class AlwaysMatchingEventFilter

java.lang.Object
org.xwiki.observation.event.filter.AlwaysMatchingEventFilter
All Implemented Interfaces:
Serializable, EventFilter

public class AlwaysMatchingEventFilter extends Object implements EventFilter, Serializable
An EventFilter that always matches another event filter.
Version:
$Id: 23993703e89d0167dc90e6e564cc37956b99f9be $
See Also:
  • Field Details

  • Constructor Details

    • AlwaysMatchingEventFilter

      @Deprecated public AlwaysMatchingEventFilter()
      Deprecated.
      since 6.0M1, use INSTANCE instead
  • Method Details

    • getFilter

      public String getFilter()
      Description copied from interface: EventFilter
      Provides access to the filter's criterion.
      Specified by:
      getFilter in interface EventFilter
      Returns:
      the filter used in the EventFilter.matches(EventFilter) method to verify if a passed event filter matches it.
      See Also:
    • matches

      public boolean matches(EventFilter eventFilter)
      Description copied from interface: EventFilter
      Compares two event filters to see if they match, meaning that the "contexts" of two events are compatible. For example, a FixedNameEventFilter matches another filter only if they both have the same name set as the filter, while an AlwaysMatchingEventFilter matches any other event filter. A listener that registered to receive notifications like referenceEvent and with referenceEventFilter, will be notified of any occuring event for which referenceEvent.matches(occuringEvent) will return true and referenceEvent.getEventFilter().matches(occurringEvent.getEventFilter()).
      Specified by:
      matches in interface EventFilter
      Parameters:
      eventFilter - the event filter to compare to the filter value
      Returns:
      true if both event filters match. The matching algorithm is left to the filter event implementation. For example the Regex event filter will match another filter if that other filter matches the regex.
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object