All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.noenv.wiremongo.matching.EqualsMatcher Maven / Gradle / Ivy

There is a newer version: 4.5.10
Show newest version
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);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy