Skip to content

Package: TriFunction

TriFunction

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2011-2019 EclipseSource Muenchen GmbH and others.
3: *
4: * All rights reserved. This program and the accompanying materials
5: * are made available under the terms of the Eclipse Public License 2.0
6: * which accompanies this distribution, and is available at
7: * https://www.eclipse.org/legal/epl-2.0/
8: *
9: * SPDX-License-Identifier: EPL-2.0
10: *
11: * Contributors:
12: * Lucas Koehler - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emfforms.common;
15:
16: import java.util.function.Function;
17:
18: /**
19: * Represents a function that accepts three arguments and produces a result.
20: * This is the three-arity specialization of {@link Function}.
21: *
22: * <p>
23: * This is a functional interface whose functional method is {@link #apply(Object, Object, Object)}.
24: *
25: * <p>
26: * This interface was introduced because Java 8 only provides {@link java.util.function.Function Function} and
27: * {@link java.util.function.BiFunction BiFunction}.
28: *
29: * @param <R> the type of the result of the function
30: * @param <T> the type of the first argument to the function
31: * @param <U> the type of the second argument to the function
32: * @param <V> the type of the third argument to the function
33: *
34: * @author Lucas Koehler
35: * @since 1.20
36: *
37: */
38: @FunctionalInterface
39: public interface TriFunction<R, T, U, V> {
40:
41:         /**
42:          * Applies this function to the given arguments.
43:          *
44:          * @param t the first function argument
45:          * @param u the second function argument
46:          * @param v the third function argument
47:          * @return the function result
48:          */
49:         R apply(T t, U u, V v);
50: }