001/* -*- mode: Java; c-basic-offset: 2; indent-tabs-mode: nil; coding: utf-8-unix -*-
002 *
003 * Copyright © 2025 microBean™.
004 *
005 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
006 * the License. You may obtain a copy of the License at
007 *
008 *     http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
011 * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
012 * specific language governing permissions and limitations under the License.
013 */
014package org.microbean.assign;
015
016import java.util.function.BiPredicate;
017
018/**
019 * A {@link BiPredicate} with particular semantics associated with its {@link #test(Object, Object) test(Object,
020 * Object)} method.
021 *
022 * @param <A> the criteria object
023 *
024 * @param <B> the object being tested
025 *
026 * @author <a href="https://about.me/lairdnelson" target="_top">Laird Nelson</a>
027 *
028 * @see #test(Object, Object)
029 */
030@FunctionalInterface
031public interface Matcher<A, B> extends BiPredicate<A, B> {
032
033  /**
034   * Returns {@code true} if and only if the second argument <dfn>matches</dfn> the first argument.
035   *
036   * @param a an object serving as a kind of criteria; must not be {@code null}
037   *
038   * @param b an object to test; must not be {@code null}
039   *
040   * @return {@code true} if and only if the second argument <dfn>matches</dfn> the first argument; {@code false}
041   * otherwise
042   *
043   * @exception NullPointerException if either {@code a} or {@code b} is {@code null}
044   */
045  @Override // BiPredicate<A, B>
046  public boolean test(final A a, final B b);
047
048}