001/* -*- mode: Java; c-basic-offset: 2; indent-tabs-mode: nil; coding: utf-8-unix -*-
002 *
003 * Copyright © 2024 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.bean;
015
016import java.util.function.BiPredicate;
017
018/**
019 * A {@link BiPredicate} with particular semantics associated with its {@link #test(Object, Object)} method.
020 *
021 * @param <A> the criteria object
022 *
023 * @param <B> the object being tested
024 *
025 * @author <a href="https://about.me/lairdnelson" target="_top">Laird Nelson</a>
026 *
027 * @see #test(Object, Object)
028 */
029@FunctionalInterface
030public interface Matcher<A, B> extends BiPredicate<A, B> {
031
032  /**
033   * Returns {@code true} if and only if the first argument <dfn>matches</dfn> the second argument.
034   *
035   * @param a an object serving as a kind of criteria; must not be {@code null}
036   *
037   * @param b an object to test; must not be {@code null}
038   *
039   * @return {@code true} if and only if the first argument <dfn>matches</dfn> the second argument; {@code false}
040   * otherwise
041   *
042   * @exception NullPointerException if either {@code a} or {@code b} is {@code null}
043   */
044  @Override // BiPredicate<A, B>
045  public boolean test(final A a, final B b);
046
047}