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.Supplier; 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 Supplier} 031 * that represents a supplier of results.}</p> 032 * <p>Different from the method 033 * {@link java.util.function.Supplier#get() Supplier.get()} 034 * the method 035 * {@link #get()} 036 * of this interface declares to throw a 037 * {@linkplain Exception checked exception}.</p> 038 * <p>As for the original interface, there is no requirement that a new or 039 * distinct result be returned each time the supplier is invoked.</p> 040 * <p>This is a functional interface whose functional method is 041 * {@link #get()}.</p> 042 * 043 * @param <T> The type of results supplied by this supplier. 044 * 045 * @author Thomas Thrien - thomas.thrien@tquadrat.org 046 * @version $Id: TCESupplier.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: TCESupplier.java 1295 2026-10-18 12:34:27Z tquadrat $" ) 053@API( status = STABLE, since = "0.0.5" ) 054public interface TCESupplier<T> 055{ 056 /*---------*\ 057 ====** Methods **========================================================== 058 \*---------*/ 059 /** 060 * <p>{@summary Returns a result.}</p> 061 * 062 * @return The result. 063 * @throws Exception Something went wrong. 064 */ 065 @SuppressWarnings( "ProhibitedExceptionDeclared" ) 066 public T get() throws Exception; 067} 068// interface TCESupplier 069 070/* 071 * End of File 072 */