public IdentifiedDataSerializable createNew(Integer arg) { return new EntryEventFilter(); } };
/** * Evaluates filters of {@link EntryEventFilter} type. * * @param filter the filter which must be a {@link EntryEventFilter} * @param dataKey the event entry key * @return {@code true} if the filter matches */ protected boolean processEntryEventFilter(EventFilter filter, Data dataKey) { EntryEventFilter eventFilter = (EntryEventFilter) filter; return eventFilter.eval(dataKey); }
@Override public int hashCode() { int result = super.hashCode(); result = 31 * result + predicate.hashCode(); return result; }
private static boolean isIncludeValue(EventFilter filter) { if (filter instanceof EntryEventFilter) { return ((EntryEventFilter) filter).isIncludeValue(); } return true; } }
@Override public void readData(ObjectDataInput in) throws IOException { super.readData(in); predicate = in.readObject(); }
@Override public void writeData(ObjectDataOutput out) throws IOException { super.writeData(out); out.writeObject(predicate); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } QueryEventFilter that = (QueryEventFilter) o; if (!super.equals(o)) { return false; } if (!predicate.equals(that.predicate)) { return false; } return true; }
private static boolean isIncludeValue(EventFilter filter) { if (filter instanceof EntryEventFilter) { return ((EntryEventFilter) filter).isIncludeValue(); } return true; } }
@Override public void readData(ObjectDataInput in) throws IOException { super.readData(in); predicate = in.readObject(); }
@Override public void writeData(ObjectDataOutput out) throws IOException { super.writeData(out); out.writeObject(predicate); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } QueryEventFilter that = (QueryEventFilter) o; if (!super.equals(o)) { return false; } if (!predicate.equals(that.predicate)) { return false; } return true; }
public IdentifiedDataSerializable createNew(Integer arg) { return new EntryEventFilter(); } };
private boolean isIncludeValue(EventFilter filter) { if (filter instanceof EntryEventFilter) { return ((EntryEventFilter) filter).isIncludeValue(); } return true; }
@Override public int hashCode() { return 31 * super.hashCode() + predicate.hashCode(); }
/** * Evaluates filters of {@link EntryEventFilter} type. * * @param filter the filter which must be a {@link EntryEventFilter} * @param dataKey the event entry key * @return {@code true} if the filter matches */ protected boolean processEntryEventFilter(EventFilter filter, Data dataKey) { EntryEventFilter eventFilter = (EntryEventFilter) filter; return eventFilter.eval(dataKey); }
@Override protected EventFilter getEventFilter() { EntryEventFilter eventFilter = new EntryEventFilter(parameters.includeValue, null); return new EventListenerFilter(parameters.listenerFlags, eventFilter); }
private boolean isIncludeValue(EventFilter filter) { if (filter instanceof EntryEventFilter) { return ((EntryEventFilter) filter).isIncludeValue(); } return true; }
@Override protected EventFilter getEventFilter() { EntryEventFilter eventFilter = new EntryEventFilter(parameters.includeValue, parameters.key); return new EventListenerFilter(parameters.listenerFlags, eventFilter); }
/** * Return {@code true} if the {@code filter} requires the entry * values (old, new, merging) to be included in the event. * * @throws IllegalArgumentException if the filter type is not known */ static boolean isIncludeValue(EventFilter filter) { // the order of the following ifs is important! // QueryEventFilter is instance of EntryEventFilter if (filter instanceof EventListenerFilter) { filter = ((EventListenerFilter) filter).getEventFilter(); } if (filter instanceof TrueEventFilter) { return true; } if (filter instanceof QueryEventFilter) { return ((QueryEventFilter) filter).isIncludeValue(); } if (filter instanceof EntryEventFilter) { return ((EntryEventFilter) filter).isIncludeValue(); } throw new IllegalArgumentException("Unknown EventFilter type = [" + filter.getClass().getCanonicalName() + "]"); }
@Override protected EventFilter getEventFilter() { EntryEventFilter eventFilter = new EntryEventFilter(parameters.includeValue, null); return new EventListenerFilter(parameters.listenerFlags, eventFilter); }