/** A {@link SerializableMatcher} that matches any {@link KV} with the specified value. */ public static <K, V extends Serializable> SerializableMatcher<KV<? extends K, ? extends V>> kvWithValue(V value) { return new KvValueMatcher<>(equalTo(value)); }
/** * A {@link SerializableMatcher} that matches any {@link KV} with the specified value. * * <p>The value of type {@code V} 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 <K, V> SerializableMatcher<KV<? extends K, ? extends V>> kvWithValue( Coder<V> coder, V value) { return new KvValueMatcher<>(equalTo(coder, value)); }
/** A {@link SerializableMatcher} that matches any {@link KV} with the specified key. */ public static <K extends Serializable, V> SerializableMatcher<KV<? extends K, ? extends V>> kvWithKey(K key) { return new KvKeyMatcher<>(equalTo(key)); }
/** * A {@link SerializableMatcher} that matches any {@link KV} with the specified key. * * <p>The key of type {@code K} 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 <K, V> SerializableMatcher<KV<? extends K, ? extends V>> kvWithKey( Coder<K> coder, K key) { return new KvKeyMatcher<>(equalTo(coder, key)); }