com.noenv.wiremongo.matching.EqualsMatcher Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of vertx-wiremongo Show documentation
Show all versions of vertx-wiremongo Show documentation
Lightweight mongo mocking for Vert.x
package com.noenv.wiremongo.matching;
import java.util.Objects;
public class EqualsMatcher implements Matcher {
private final T value;
private EqualsMatcher(T value) {
this.value = value;
}
@Override
public boolean matches(T other) {
return Objects.equals(value, other);
}
public static EqualsMatcher equalTo(T value) {
return new EqualsMatcher<>(value);
}
public static Matcher notEqualTo(T value) {
return o -> !equalTo(value).matches(o);
}
}