001/* 002 * ============================================================================ 003 * Copyright © 2002-2021 by Thomas Thrien. 004 * All Rights Reserved. 005 * ============================================================================ 006 * Licensed to the public under the agreements of the GNU Lesser General Public 007 * License, version 3.0 (the "License"). You may obtain a copy of the License at 008 * 009 * http://www.gnu.org/licenses/lgpl.html 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 013 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 014 * License for the specific language governing permissions and limitations 015 * under the License. 016 */ 017 018package org.tquadrat.foundation.lang; 019 020import static org.apiguardian.api.API.Status.STABLE; 021 022import java.util.function.Supplier; 023 024import org.apiguardian.api.API; 025import org.tquadrat.foundation.annotation.ClassVersion; 026 027/** 028 * <p>{@summary A variant of the interface 029 * {@link Supplier} 030 * with a 031 * {@link #get()} 032 * method that allows to throw an exception.}</p> 033 * <p>This is a functional interface whose functional method is 034 * {@link #get()}.</p> 035 * 036 * @param <R> The type of the operation's result. 037 * 038 * @version $Id: Operation.java 993 2022-01-19 22:26:20Z tquadrat $ 039 * @extauthor Thomas Thrien - thomas.thrien@tquadrat.org 040 * @UMLGraph.link 041 * @since 0.1.0 042 */ 043@SuppressWarnings( "ProhibitedExceptionDeclared" ) 044@FunctionalInterface 045@ClassVersion( sourceVersion = "$Id: Operation.java 993 2022-01-19 22:26:20Z tquadrat $" ) 046@API( status = STABLE, since = "0.1.0" ) 047public interface Operation<R> 048{ 049 /*---------*\ 050 ====** Methods **========================================================== 051 \*---------*/ 052 /** 053 * The operation. 054 * 055 * @return The operation's result. 056 * 057 * @throws Exception Something went wrong. 058 */ 059 public abstract R get() throws Exception; 060} 061// interface Operation 062 063/* 064 * End of File 065 */