@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; DefaultPredicate<?, ?> that = (DefaultPredicate<?, ?>) o; return getDocType().equals(that.getDocType()) && getViewType().equals(that.getViewType()); }
/** * @return A predicate that applies to document windows with the given {@code viewType}. */ static <V> Predicate<Object, V> view(Class<V> viewType) { return new DefaultPredicate<>(Object.class, viewType); }
/** * @return A predicate that applies to document windows with the given {@code docType}. */ static <D> Predicate<D, Object> doc(Class<D> docType) { return new DefaultPredicate<>(docType, Object.class); }
@Override public int hashCode() { int result = getDocType().hashCode(); result = 31 * result + getViewType().hashCode(); return result; } }
/** * @return A predicate that applies to document windows with the given {@code docType} and {@code viewType}. */ static <D, V> Predicate<D, V> docView(Class<D> docType, Class<V> viewType) { return new DefaultPredicate<>(docType, viewType); } }