com.liferay.apio.architect.function.UndecaFunction Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of release.portal.api Show documentation
Show all versions of release.portal.api Show documentation
POM was created by Sonatype Nexus
/**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/
package com.liferay.apio.architect.function;
import aQute.bnd.annotation.ConsumerType;
import java.util.Objects;
import java.util.function.Function;
/**
* Defines a {@code Function} that takes eleven input parameters. This
* interface, like all function interfaces, receives several arguments and
* returns one value of type {@code R}.
*
*
* This interface can be implemented with a lambda function.
*
*
* @author Alejandro Hernández
* @param the type of the first argument of the function
* @param the type of the second argument of the function
* @param the type of the third argument of the function
* @param the type of the fourth argument of the function
* @param the type of the fifth argument of the function
* @param the type of the sixth argument of the function
* @param the type of the seventh argument of the function
* @param the type of the eighth argument of the function
* @param the type of the ninth argument of the function
* @param the type of the tenth argument of the function
* @param the type of the result of the function
*/
@ConsumerType
@FunctionalInterface
public interface UndecaFunction {
/**
* Returns the {@code UndecaFunction} that first executes the current {@code
* UndecaFunction} instance's {@code apply} method, then uses the result as
* input for the {@code afterFunction} parameter's {@code apply} method.
*
* @param afterFunction the {@code UndecaFunction} to execute after the
* current instance
* @return the {@code UndecaFunction} that executes the current instance's
* {@code apply} method, then uses the result as input for the
* {@code afterFunction} parameter's {@code apply} method
*/
public default UndecaFunction
andThen(Function afterFunction) {
Objects.requireNonNull(afterFunction);
return (A a, B b, C c, D d, E e, F f, G g, H h, I i, J j, K k) ->
afterFunction.apply(apply(a, b, c, d, e, f, g, h, i, j, k));
}
/**
* Applies the current {@code UndecaFunction} and returns a value of type
* {@code R}. This function can be implemented explicitly or with a lambda.
*
* @param a the function's first argument
* @param b the function's second argument
* @param c the function's third argument
* @param d the function's fourth argument
* @param e the function's fifth argument
* @param f the function's sixth argument
* @param g the function's seventh argument
* @param h the function's eighth argument
* @param i the function's ninth argument
* @param j the function's tenth argument
* @param k the function's eleventh argument
* @return the function's result, as a value of type {@code R}
*/
public R apply(A a, B b, C c, D d, E e, F f, G g, H h, I i, J j, K k);
}