/** * A {@link SerializableMatcher} with identical criteria to {@link * Matchers#containsInAnyOrder(Matcher[])}. */ @SafeVarargs public static <T> SerializableMatcher<Iterable<? extends T>> containsInAnyOrder( final SerializableMatcher<? super T>... matchers) { return fromSupplier(() -> Matchers.containsInAnyOrder(matchers)); }
/** * A {@link SerializableMatcher} with identical criteria to {@link * Matchers#arrayContainingInAnyOrder(Matcher[])}. */ @SafeVarargs public static <T> SerializableMatcher<T[]> arrayContainingInAnyOrder( final SerializableMatcher<? super T>... matchers) { return fromSupplier(() -> Matchers.arrayContainingInAnyOrder(matchers)); }
/** * A {@link SerializableMatcher} with identical criteria to {@link Matchers#arrayWithSize(int)}. */ public static <T> SerializableMatcher<T[]> arrayWithSize(final int size) { return fromSupplier(() -> Matchers.arrayWithSize(size)); }
/** * A {@link SerializableMatcher} with identical criteria to {@link * Matchers#closeTo(double,double)}. */ public static SerializableMatcher<Double> closeTo(final double target, final double error) { return fromSupplier(() -> Matchers.closeTo(target, error)); }
/** * A {@link SerializableMatcher} with identical criteria to {@link * Matchers#arrayContaining(List)}. */ public static <T> SerializableMatcher<T[]> arrayContaining( List<SerializableMatcher<? super T>> serializableMatchers) { @SuppressWarnings({"rawtypes", "unchecked"}) // safe covariant cast final List<Matcher<? super T>> matchers = (List) serializableMatchers; return fromSupplier(() -> Matchers.arrayContaining(matchers)); }
/** * A {@link SerializableMatcher} with identical criteria to {@link * Matchers#arrayContainingInAnyOrder(Collection)}. */ public static <T> SerializableMatcher<T[]> arrayContainingInAnyOrder( Collection<SerializableMatcher<? super T>> serializableMatchers) { @SuppressWarnings({"rawtypes", "unchecked"}) // safe covariant cast final Collection<Matcher<? super T>> matchers = (Collection) serializableMatchers; return fromSupplier(() -> Matchers.arrayContainingInAnyOrder(matchers)); }
/** * A {@link SerializableMatcher} with identical criteria to {@link * Matchers#iterableWithSize(int)}. */ public static <T> SerializableMatcher<Iterable<T>> iterableWithSize(final int size) { return fromSupplier(() -> Matchers.iterableWithSize(size)); }
/** A {@link SerializableMatcher} with identical criteria to {@link Matchers#anyOf(Iterable)}. */ public static <T> SerializableMatcher<T> anyOf( Iterable<SerializableMatcher<? super T>> serializableMatchers) { @SuppressWarnings({"rawtypes", "unchecked"}) // safe covariant cast final Iterable<Matcher<? super T>> matchers = (Iterable) serializableMatchers; return fromSupplier(() -> Matchers.anyOf(matchers)); }
/** * A {@link SerializableMatcher} with identical criteria to {@link * Matchers#arrayContaining(Object[])}. */ @SafeVarargs public static <T extends Serializable> SerializableMatcher<T[]> arrayContaining( final T... items) { return fromSupplier(() -> Matchers.arrayContaining(items)); }
/** * A {@link SerializableMatcher} with identical criteria to {@link * Matchers#arrayContainingInAnyOrder(Object[])}. */ @SafeVarargs public static <T extends Serializable> SerializableMatcher<T[]> arrayContainingInAnyOrder( final T... items) { return fromSupplier(() -> Matchers.arrayContainingInAnyOrder(items)); }
/** * A {@link SerializableMatcher} with identical criteria to {@link * Matchers#lessThanOrEqualTo(Comparable)}. */ public static <T extends Comparable<T> & Serializable> SerializableMatcher<T> lessThanOrEqualTo( final T target) { return fromSupplier(() -> Matchers.lessThanOrEqualTo(target)); }
/** * A {@link SerializableMatcher} with identical criteria to {@link Matchers#contains(Object[])}. * * <p>The items of type {@code T} will be serialized using the provided {@link Coder}. They are * explicitly <i>not</i> required or expected to be serializable via Java serialization. */ @SafeVarargs public static <T> SerializableMatcher<Iterable<? extends T>> contains( Coder<T> coder, T... items) { final SerializableSupplier<T[]> itemsSupplier = new SerializableArrayViaCoder<>(coder, items); return fromSupplier(() -> Matchers.containsInAnyOrder(itemsSupplier.get())); }
/** * A {@link SerializableMatcher} with identical criteria to {@link Matchers#equalTo(Object)}. * * <p>The expected value of type {@code T} will be serialized using the provided {@link Coder}. It * is explicitly <i>not</i> required or expected to be serializable via Java serialization. */ public static <T> SerializableMatcher<T> equalTo(Coder<T> coder, T expected) { final SerializableSupplier<T> expectedSupplier = new SerializableViaCoder<>(coder, expected); return fromSupplier(() -> Matchers.equalTo(expectedSupplier.get())); }
/** * A {@link SerializableMatcher} with identical criteria to {@link Matchers#hasItem(Object)}. * * <p>The item of type {@code T} will be serialized using the provided {@link Coder}. It is * explicitly <i>not</i> required or expected to be serializable via Java serialization. */ public static <T> SerializableMatcher<Iterable<? super T>> hasItem(Coder<T> coder, T target) { final SerializableSupplier<T> targetSupplier = new SerializableViaCoder<>(coder, target); return fromSupplier(() -> Matchers.hasItem(targetSupplier.get())); }
/** * A {@link SerializableMatcher} with identical criteria to {@link * Matchers#greaterThan(Comparable)}. * * <p>The target value of type {@code T} will be serialized using the provided {@link Coder}. It * is explicitly <i>not</i> required or expected to be serializable via Java serialization. */ public static <T extends Comparable<T> & Serializable> SerializableMatcher<T> greaterThan( final Coder<T> coder, T target) { final SerializableSupplier<T> targetSupplier = new SerializableViaCoder<>(coder, target); return fromSupplier(() -> Matchers.greaterThan(targetSupplier.get())); }
/** * A {@link SerializableMatcher} with identical criteria to {@link * Matchers#arrayContaining(Object[])}. * * <p>The items of type {@code T} will be serialized using the provided {@link Coder}. They are * explicitly <i>not</i> required or expected to be serializable via Java serialization. */ @SafeVarargs public static <T> SerializableMatcher<T[]> arrayContaining(Coder<T> coder, T... items) { final SerializableSupplier<T[]> itemsSupplier = new SerializableArrayViaCoder<>(coder, items); return fromSupplier(() -> Matchers.arrayContaining(itemsSupplier.get())); }
/** * A {@link SerializableMatcher} with identical criteria to {@link * Matchers#greaterThanOrEqualTo(Comparable)}. * * <p>The target value of type {@code T} will be serialized using the provided {@link Coder}. It * is explicitly <i>not</i> required or expected to be serializable via Java serialization. */ public static <T extends Comparable<T> & Serializable> SerializableMatcher<T> greaterThanOrEqualTo(final Coder<T> coder, T target) { final SerializableSupplier<T> targetSupplier = new SerializableViaCoder<>(coder, target); return fromSupplier(() -> Matchers.greaterThanOrEqualTo(targetSupplier.get())); }
/** * A {@link SerializableMatcher} with identical criteria to {@link Matchers#lessThan(Comparable)}. * * <p>The target value of type {@code T} will be serialized using the provided {@link Coder}. It * is explicitly <i>not</i> required or expected to be serializable via Java serialization. */ public static <T extends Comparable<T>> SerializableMatcher<T> lessThan( Coder<T> coder, T target) { final SerializableSupplier<T> targetSupplier = new SerializableViaCoder<>(coder, target); return fromSupplier(() -> Matchers.lessThan(targetSupplier.get())); }
/** * A {@link SerializableMatcher} with identical criteria to {@link Matchers#isIn(Object[])}. * * <p>The items of type {@code T} will be serialized using the provided {@link Coder}. They are * explicitly <i>not</i> required or expected to be serializable via Java serialization. */ public static <T> SerializableMatcher<T> isIn(Coder<T> coder, T[] items) { final SerializableSupplier<T[]> itemsSupplier = new SerializableArrayViaCoder<>(coder, items); return fromSupplier(() -> Matchers.isIn(itemsSupplier.get())); }
/** * A {@link SerializableMatcher} with identical criteria to {@link * Matchers#lessThanOrEqualTo(Comparable)}. * * <p>The target value of type {@code T} will be serialized using the provided {@link Coder}. It * is explicitly <i>not</i> required or expected to be serializable via Java serialization. */ public static <T extends Comparable<T>> SerializableMatcher<T> lessThanOrEqualTo( Coder<T> coder, T target) { final SerializableSupplier<T> targetSupplier = new SerializableViaCoder<>(coder, target); return fromSupplier(() -> Matchers.lessThanOrEqualTo(targetSupplier.get())); }