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

function.ObjBiCharPredicate Maven / Gradle / Ivy

Go to download

Supplementary utilities for classes that belong to java.util, or are considered essential as to justify existence in java.util.

The newest version!
/* Copyright (c) 2022 LibJ
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * You should have received a copy of The MIT License (MIT) along with this
 * program. If not, see .
 */

package org.libj.util.function;

import java.util.Objects;

import javax.annotation.Generated;

/**
 * Represents a predicate (boolean-valued function) that accepts an object-valued
 * argument and two {@code char}-valued arguments. This is the {@code char}-consuming
 * primitive type specialization of {@link java.util.function.Predicate}.
 *
 * @param  The type of the argument to the predicate.
 *
 * @see java.util.function.Predicate
 */
@FunctionalInterface
@Generated(value="org.openjax.codegen.template.Templates", date="2024-02-27T13:50:20.763")
public interface ObjBiCharPredicate {
  /**
   * Evaluates this predicate on the given argument.
   *
   * @param t The first input argument.
   * @param v1 The second input argument.
   * @param v2 The third input argument.
   * @return {@code true} if the input argument matches the predicate, otherwise
   *         {@code false}.
   */
  boolean test(T t, char v1, char v2);

  /**
   * Returns a composed predicate that represents a short-circuiting logical AND
   * of this predicate and another. When evaluating the composed predicate, if
   * this predicate is {@code false}, then the {@code other} predicate is not
   * evaluated.
   * 

* Any exceptions thrown during evaluation of either predicate are relayed to * the caller; if evaluation of this predicate throws an exception, the * {@code other} predicate will not be evaluated. * * @param other A predicate that will be logically-ANDed with this predicate * @return A composed predicate that represents the short-circuiting logical * AND of this predicate and the {@code other} predicate. * @throws NullPointerException If {@code other} is null. */ default ObjBiCharPredicate and(final ObjBiCharPredicate other) { Objects.requireNonNull(other); return (t, v1, v2) -> test(t, v1, v2) && other.test(t, v1, v2); } /** * Returns a predicate that represents the logical negation of this predicate. * * @return A predicate that represents the logical negation of this predicate. */ default ObjBiCharPredicate negate() { return (t, v1, v2) -> !test(t, v1, v2); } /** * Returns a composed predicate that represents a short-circuiting logical OR * of this predicate and another. When evaluating the composed predicate, if * this predicate is {@code true}, then the {@code other} predicate is not * evaluated. *

* Any exceptions thrown during evaluation of either predicate are relayed to * the caller; if evaluation of this predicate throws an exception, the * {@code other} predicate will not be evaluated. * * @param other A predicate that will be logically-ORed with this predicate. * @return A composed predicate that represents the short-circuiting logical * OR of this predicate and the {@code other} predicate. * @throws NullPointerException if {@code other} is null. */ default ObjBiCharPredicate or(final ObjBiCharPredicate other) { Objects.requireNonNull(other); return (t, v1, v2) -> test(t, v1, v2) || other.test(t, v1, v2); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy