001/* 002 * ============================================================================ 003 * Copyright © 2002-2020 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.Consumer; 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 Consumer} 031 * that represents an operation that accepts a single input argument and 032 * returns no result.} Unlike most other functional interfaces, 033 * {@code Consumer} is expected to operate via side effects.</p> 034 * <p>Different from the method 035 * {@link java.util.function.Consumer#accept(Object) Consumer.accept()} 036 * the method 037 * {@link #accept(Object)} 038 * of this interface declares to throw a 039 * {@linkplain Exception checked exception}.</p> 040 * <p>This is a functional interface whose functional method is 041 * {@link #accept(Object)}.</p> 042 * 043 * @param <T> The type of the input to the operation. 044 * 045 * @author Thomas Thrien - thomas.thrien@tquadrat.org 046 * @version $Id: TCEConsumer.java 1295 2026-10-18 12:34:27Z tquadrat $ 047 * @since 0.0.5 048 * 049 * @UMLGraph.link 050 */ 051@FunctionalInterface 052@ClassVersion( sourceVersion = "$Id: TCEConsumer.java 1295 2026-10-18 12:34:27Z tquadrat $" ) 053@API( status = STABLE, since = "0.0.5" ) 054public interface TCEConsumer<T> 055{ 056 /*---------*\ 057 ====** Methods **========================================================== 058 \*---------*/ 059 /** 060 * <p>{@summary Performs this operation on the given argument.}</p> 061 * 062 * @param arg The input argument 063 * @throws Exception Something went wrong. 064 */ 065 @SuppressWarnings( "ProhibitedExceptionDeclared" ) 066 public void accept( T arg ) throws Exception; 067} 068// interface TCEConsumer 069 070/* 071 * End of File 072 */