|
| 1 | +package org.scijava.ops.core; |
| 2 | + |
| 3 | +import java.util.Objects; |
| 4 | +import java.util.function.Consumer; |
| 5 | + |
| 6 | +/** |
| 7 | + * Represents an operation that accepts nine input arguments and returns no |
| 8 | + * result. This is the nine-arity specialization of {@link Consumer}. Unlike most |
| 9 | + * other functional interfaces, {@code Consumer9} is expected to operate via |
| 10 | + * side-effects. |
| 11 | + * |
| 12 | + * <p> |
| 13 | + * This is a <a href="package-summary.html">functional interface</a> whose |
| 14 | + * functional method is {@link #accept(Object, Object)}. |
| 15 | + * |
| 16 | + * @param <T> |
| 17 | + * the type of the first argument to the operation |
| 18 | + * @param <U> |
| 19 | + * the type of the second argument to the operation |
| 20 | + * @param <V> |
| 21 | + * the type of the third argument to the operation |
| 22 | + * @param <W> |
| 23 | + * the type of the fourth argument to the operation |
| 24 | + * @param <X> |
| 25 | + * the type of the fifth argument to the operation |
| 26 | + * @param <Y> |
| 27 | + * the type of the sixth argument to the operation |
| 28 | + * @param <Z> |
| 29 | + * the type of the seventh argument to the operation |
| 30 | + * @param <A> |
| 31 | + * the type of the eighth argument to the operation |
| 32 | + * @param <B> |
| 33 | + * the type of the ninth argument to the operation |
| 34 | + * @param <C> |
| 35 | + * the type of the tenth argument to the operation |
| 36 | + * |
| 37 | + * @see Consumer |
| 38 | + * @since 1.8 |
| 39 | + */ |
| 40 | +@FunctionalInterface |
| 41 | +public interface Consumer10<T, U, V, W, X, Y, Z, A, B, C> { |
| 42 | + |
| 43 | + /** |
| 44 | + * Performs this operation on the given arguments. |
| 45 | + * |
| 46 | + * @param t |
| 47 | + * the first input argument |
| 48 | + * @param u |
| 49 | + * the second input argument |
| 50 | + * @param v |
| 51 | + * the third input argument |
| 52 | + * @param w |
| 53 | + * the fourth input argument |
| 54 | + * @param x |
| 55 | + * the fifth input argument |
| 56 | + * @param y |
| 57 | + * the sixth input argument |
| 58 | + * @param z |
| 59 | + * the seventh input argument |
| 60 | + * @param a |
| 61 | + * the eighth input argument |
| 62 | + * @param b |
| 63 | + * the ninth input argument |
| 64 | + * @param c |
| 65 | + * the tenth input argument |
| 66 | + */ |
| 67 | + void accept(T t, U u, V v, W w, X x, Y y, Z z, A a, B b, C c); |
| 68 | + |
| 69 | + /** |
| 70 | + * Returns a composed {@code Consumer9} that performs, in sequence, this |
| 71 | + * operation followed by the {@code after} operation. If performing either |
| 72 | + * operation throws an exception, it is relayed to the caller of the composed |
| 73 | + * operation. If performing this operation throws an exception, the |
| 74 | + * {@code after} operation will not be performed. |
| 75 | + * |
| 76 | + * @param after |
| 77 | + * the operation to perform after this operation |
| 78 | + * @return a composed {@code Consumer9} that performs in sequence this |
| 79 | + * operation followed by the {@code after} operation |
| 80 | + * @throws NullPointerException |
| 81 | + * if {@code after} is null |
| 82 | + */ |
| 83 | + default Consumer10<T, U, V, W, X, Y, Z, A, B, C> andThen( |
| 84 | + Consumer10<? super T, ? super U, ? super V, ? super W, ? super X, ? super Y, ? super Z, ? super A, ? super B, ? super C> after) { |
| 85 | + Objects.requireNonNull(after); |
| 86 | + |
| 87 | + return (t, u, v, w, x, y, z, a, b, c) -> { |
| 88 | + accept(t, u, v, w, x, y, z, a, b, c); |
| 89 | + after.accept(t, u, v, w, x, y, z, a, b, c); |
| 90 | + }; |
| 91 | + } |
| 92 | +} |
0 commit comments