/* (non-Javadoc)
@see org.archive.wayback.util.ObjectFilter#filterObject(java.lang.Object)
763960
public int filterObject(CaptureSearchResult r) {
		String mime = r.getMimeType().toLowerCase();
		return validMimes.containsKey(mime) == includeIfContains ? 
				FILTER_INCLUDE : FILTER_EXCLUDE;
	}
811113
public T filter(@NonNull SerializablePredicate<? super HString> filter) {
      this.filter = filter;
      return Cast.as(this);
   }
13983
function _filterByObjectSchema(data, schema) {
    return Object
        .keys(data)
        .filter(function (key) {
            return schema.hasOwnProperty(key);
        })
        .reduce(function (memo, key) {
            var value = data[key];
            var schemaPart = schema[key];
            if (typeof schemaPart === 'object') {
                memo[key] = _filter(value, schemaPart);
            } else {
                memo[key] = value;
            }
            return memo;
        }, {});
}
264450
public static <E> Filter<E> collectionAcceptFilter(Collection<E> objs) {
    return new CollectionAcceptFilter<E>(objs, true);
  }
912971
@Override
	public int filterObject(CaptureSearchResult r) {
		String captureScheme = UrlOperations.urlToScheme(r.getOriginalUrl());
		if(scheme == null) {
			if(captureScheme == null) {
				return FILTER_INCLUDE;
			} else {
				annotationTarget.addCloseMatch(r.getOriginalHost(),
						r.getOriginalUrl());
				return FILTER_EXCLUDE;
			}
		}

		if(scheme.equals(captureScheme)) {
			return FILTER_INCLUDE;
		} else {
			if(annotationTarget != null) {
				annotationTarget.addCloseMatch(r.getOriginalHost(),
						r.getOriginalUrl());
			}
			 return FILTER_EXCLUDE;
		}
	}
40675
public int filterObject(CaptureSearchResult o) {
		String thisUrl = o.getOriginalUrl();
		String thisDate = o.getCaptureTimestamp();
		int result = ObjectFilter.FILTER_INCLUDE;
		if(lastUrl != null) {
			if(lastUrl.equals(thisUrl) && thisDate.equals(lastDate)) {
				result = FILTER_EXCLUDE;
			}
		}
		lastUrl = thisUrl;
		lastDate = thisDate;
		return result;
	}
719202
@Override
    public void doFilter(EventRequest request, EventResponse response, FilterChain chain) throws IOException,
            PortletException {
        doCommonFilter(request, response, chain);
    }
411453
public static Predicate<Triple> filterWithLDF(final String subject, final String predicate,
            final String object) {
        return triple -> !(notCompareWithString(triple.getSubject(), subject)
                    || notCompareWithString(triple.getPredicate(), predicate)
                    || notCompareWithString(triple.getObject(), object));
    }
1315325
public <T> T readObject() throws IOException, ClassNotFoundException {
        ObjectInputStream ois = new ObjectInputStreamEx(in,
                getClass().getClassLoader(), ClassFilter.DEFAULT);
        return (T)ois.readObject();
    }
1305306
public static br[] get_filtered(nitro_service service, String filter) throws Exception
	{
		br obj = new br();
		options option = new options();
		option.set_filter(filter);
		br[] response = (br[]) obj.getfiltered(service, option);
		return response;
	}
1139880
function filterfrom(filter, o) {
		var t = filter(o);
		if (gui.Type.isConstructor(t)) {
			t = constructas(t, o);
		} else if (edb.Type.is(t) || t === null) {
			t = t;
		} else {
			fail(
				'edb.Type constructor or instance',
				gui.Type.of(t),
				'return null for nothing'
			);
		}
		return t;
	}
828999
@Override
    public void filterWrite(NextFilter nextFilter, IoSession session,
            WriteRequest writeRequest) throws Exception {

        Object data = writeRequest.getMessage();

        if (data instanceof IoBuffer) {
            write(session, (IoBuffer) data);
        } else {
            throw new IllegalArgumentException(
                    "This filter should only buffer IoBuffer objects");
        }
    }
292461
@CheckResult
    @NonNull
    public final Data<T> filter(@NonNull Predicate<? super T> predicate) {
        return new FilterData<>(this, predicate);
    }
1137651
protected DbEntity cacheFilter(DbEntity persistentObject) {
    DbEntity cachedPersistentObject = dbEntityCache.get(persistentObject.getClass(), persistentObject.getId());
    if (cachedPersistentObject!=null) {
      return cachedPersistentObject;
    }
    else {
      return persistentObject;
    }

  }
208238
public int filterObject(CaptureSearchResult r) {
		String captureDate = r.getCaptureTimestamp();
		return (startDate.substring(0,captureDate.length()).compareTo(
				captureDate) > 0) ? 
				FILTER_ABORT : FILTER_INCLUDE; 
	}
1057166
public static lbmonbindings[] get_filtered(nitro_service service, lbmonbindings obj, String filter) throws Exception{
		options option = new options();
		option.set_filter(filter);
		option.set_args(nitro_util.object_to_string_withoutquotes(obj));
		lbmonbindings[] response = (lbmonbindings[]) obj.getfiltered(service, option);
		return response;
	}
312939
public int filterObject(CaptureSearchResult o) {
		if(client != null) {
			String url = o.getOriginalUrl();
			Date capDate = o.getCaptureDate();
			try {
				Rule r = client.getRule(url, capDate, new Date(), who);
				if(r != null) {
					String publicComment = r.getPublicComment();
					o.putCustom("ANOTATION", publicComment);
				}
			} catch (RuleOracleUnavailableException e) {
				e.printStackTrace();
				// should not happen: we forcibly disable robots retrievals 
			}
		}
		return FILTER_INCLUDE;
	}