001/*
002 * ============================================================================
003 * Copyright © 2002-2026 by Thomas Thrien.
004 * All Rights Reserved.
005 * ============================================================================
006 *
007 * Licensed to the public under the agreements of the GNU Lesser General Public
008 * License, version 3.0 (the "License"). You may obtain a copy of the License at
009 *
010 *      http://www.gnu.org/licenses/lgpl.html
011 *
012 * Unless required by applicable law or agreed to in writing, software
013 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
014 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
015 * License for the specific language governing permissions and limitations
016 * under the License.
017 */
018
019package org.tquadrat.foundation.function.tce;
020
021import static org.apiguardian.api.API.Status.STABLE;
022
023import java.util.function.Predicate;
024
025import org.apiguardian.api.API;
026import org.tquadrat.foundation.annotation.ClassVersion;
027
028/**
029 *  <p>{@summary The TCE version of the interface
030 *  {@link Predicate}
031 *  that represents a predicate (boolean-valued function) of one argument.}</p>
032 *  <p>Different from the method
033 *  {@link java.util.function.Predicate#test(Object) Predicate.test()}
034 *  the method
035 *  {@link #test(Object)}
036 *  of this interface declares to throw a
037 *  {@linkplain Exception checked exception}.</p>
038 *  <p>This is a functional interface whose functional method is
039 *  {@link #test(Object)}.</p>
040 *
041 *  @param <T> The type of the input to the predicate.
042 *
043 *  @author Thomas Thrien - thomas.thrien@tquadrat.org
044 *  @version $Id: TCEPredicate.java 1295 2026-10-18 12:34:27Z tquadrat $
045 *  @since 0.0.5
046 *
047 *  @UMLGraph.link
048 */
049@FunctionalInterface
050@ClassVersion( sourceVersion = "$Id: TCEPredicate.java 1295 2026-10-18 12:34:27Z tquadrat $" )
051@API( status = STABLE, since = "0.0.5" )
052public interface TCEPredicate<T>
053{
054        /*---------*\
055    ====** Methods **==========================================================
056        \*---------*/
057    /**
058     *  <p>{@summary Evaluates this predicate on the given argument.}</p>
059     *
060     *  @param  arg The input argument
061     *  @return {@true} if the input argument matches the predicate,
062     *      otherwise {@false}.
063     *  @throws Exception   Something went wrong.
064     */
065    @SuppressWarnings( {"ProhibitedExceptionDeclared", "BooleanMethodNameMustStartWithQuestion"} )
066    public boolean test( T arg ) throws Exception;
067}
068//  interface TCEPredicate
069
070/*
071 *  End of File
072 */