/** * 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#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#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#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#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#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())); }