From commits-return-7721-archive-asf-public=cust-asf.ponee.io@groovy.apache.org Tue Nov 27 14:59:23 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id C69CC180789 for ; Tue, 27 Nov 2018 14:59:20 +0100 (CET) Received: (qmail 79231 invoked by uid 500); 27 Nov 2018 13:59:19 -0000 Mailing-List: contact commits-help@groovy.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@groovy.apache.org Delivered-To: mailing list commits@groovy.apache.org Received: (qmail 79131 invoked by uid 99); 27 Nov 2018 13:59:19 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Nov 2018 13:59:19 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 38171E131A; Tue, 27 Nov 2018 13:59:19 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sunlan@apache.org To: commits@groovy.apache.org Date: Tue, 27 Nov 2018 13:59:22 -0000 Message-Id: In-Reply-To: <5b7fa31672d348d4872068c7d1d9ebd2@git.apache.org> References: <5b7fa31672d348d4872068c7d1d9ebd2@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [4/8] groovy git commit: Move tuple improvements to its own project http://git-wip-us.apache.org/repos/asf/groovy/blob/892f67cd/src/main/groovy/groovy/util/function/Consumer13.java ---------------------------------------------------------------------- diff --git a/src/main/groovy/groovy/util/function/Consumer13.java b/src/main/groovy/groovy/util/function/Consumer13.java deleted file mode 100644 index d032a3b..0000000 --- a/src/main/groovy/groovy/util/function/Consumer13.java +++ /dev/null @@ -1,239 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package groovy.util.function; - -import groovy.lang.Tuple1; -import groovy.lang.Tuple10; -import groovy.lang.Tuple11; -import groovy.lang.Tuple12; -import groovy.lang.Tuple13; -import groovy.lang.Tuple2; -import groovy.lang.Tuple3; -import groovy.lang.Tuple4; -import groovy.lang.Tuple5; -import groovy.lang.Tuple6; -import groovy.lang.Tuple7; -import groovy.lang.Tuple8; -import groovy.lang.Tuple9; - - -/** - * A consumer with 13 arguments. - * - * @since 3.0.0 - */ -@FunctionalInterface -public interface Consumer13 { - - /** - * Performs this operation on the given argument. - * - * @param args The arguments as a tuple. - */ - default void accept(Tuple13 args) { - accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), args.getV6(), args.getV7(), args.getV8(), args.getV9(), args.getV10(), args.getV11(), args.getV12(), args.getV13()); - } - - /** - * Performs this operation on the given argument. - */ - void accept(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13); - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer12 acceptPartially(T1 v1) { - return (v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer11 acceptPartially(T1 v1, T2 v2) { - return (v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer10 acceptPartially(T1 v1, T2 v2, T3 v3) { - return (v4, v5, v6, v7, v8, v9, v10, v11, v12, v13) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer9 acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4) { - return (v5, v6, v7, v8, v9, v10, v11, v12, v13) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer8 acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5) { - return (v6, v7, v8, v9, v10, v11, v12, v13) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer7 acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6) { - return (v7, v8, v9, v10, v11, v12, v13) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer6 acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7) { - return (v8, v9, v10, v11, v12, v13) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer5 acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8) { - return (v9, v10, v11, v12, v13) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer4 acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9) { - return (v10, v11, v12, v13) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer3 acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10) { - return (v11, v12, v13) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer2 acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11) { - return (v12, v13) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer1 acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12) { - return (v13) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer0 acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13) { - return () -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer12 acceptPartially(Tuple1 args) { - return (v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13) -> accept(args.getV1(), v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer11 acceptPartially(Tuple2 args) { - return (v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13) -> accept(args.getV1(), args.getV2(), v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer10 acceptPartially(Tuple3 args) { - return (v4, v5, v6, v7, v8, v9, v10, v11, v12, v13) -> accept(args.getV1(), args.getV2(), args.getV3(), v4, v5, v6, v7, v8, v9, v10, v11, v12, v13); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer9 acceptPartially(Tuple4 args) { - return (v5, v6, v7, v8, v9, v10, v11, v12, v13) -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), v5, v6, v7, v8, v9, v10, v11, v12, v13); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer8 acceptPartially(Tuple5 args) { - return (v6, v7, v8, v9, v10, v11, v12, v13) -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), v6, v7, v8, v9, v10, v11, v12, v13); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer7 acceptPartially(Tuple6 args) { - return (v7, v8, v9, v10, v11, v12, v13) -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), args.getV6(), v7, v8, v9, v10, v11, v12, v13); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer6 acceptPartially(Tuple7 args) { - return (v8, v9, v10, v11, v12, v13) -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), args.getV6(), args.getV7(), v8, v9, v10, v11, v12, v13); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer5 acceptPartially(Tuple8 args) { - return (v9, v10, v11, v12, v13) -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), args.getV6(), args.getV7(), args.getV8(), v9, v10, v11, v12, v13); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer4 acceptPartially(Tuple9 args) { - return (v10, v11, v12, v13) -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), args.getV6(), args.getV7(), args.getV8(), args.getV9(), v10, v11, v12, v13); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer3 acceptPartially(Tuple10 args) { - return (v11, v12, v13) -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), args.getV6(), args.getV7(), args.getV8(), args.getV9(), args.getV10(), v11, v12, v13); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer2 acceptPartially(Tuple11 args) { - return (v12, v13) -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), args.getV6(), args.getV7(), args.getV8(), args.getV9(), args.getV10(), args.getV11(), v12, v13); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer1 acceptPartially(Tuple12 args) { - return (v13) -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), args.getV6(), args.getV7(), args.getV8(), args.getV9(), args.getV10(), args.getV11(), args.getV12(), v13); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer0 acceptPartially(Tuple13 args) { - return () -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), args.getV6(), args.getV7(), args.getV8(), args.getV9(), args.getV10(), args.getV11(), args.getV12(), args.getV13()); - } -} http://git-wip-us.apache.org/repos/asf/groovy/blob/892f67cd/src/main/groovy/groovy/util/function/Consumer14.java ---------------------------------------------------------------------- diff --git a/src/main/groovy/groovy/util/function/Consumer14.java b/src/main/groovy/groovy/util/function/Consumer14.java deleted file mode 100644 index d0ce07b..0000000 --- a/src/main/groovy/groovy/util/function/Consumer14.java +++ /dev/null @@ -1,254 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package groovy.util.function; - -import groovy.lang.Tuple1; -import groovy.lang.Tuple10; -import groovy.lang.Tuple11; -import groovy.lang.Tuple12; -import groovy.lang.Tuple13; -import groovy.lang.Tuple14; -import groovy.lang.Tuple2; -import groovy.lang.Tuple3; -import groovy.lang.Tuple4; -import groovy.lang.Tuple5; -import groovy.lang.Tuple6; -import groovy.lang.Tuple7; -import groovy.lang.Tuple8; -import groovy.lang.Tuple9; - - -/** - * A consumer with 14 arguments. - * - * @since 3.0.0 - */ -@FunctionalInterface -public interface Consumer14 { - - /** - * Performs this operation on the given argument. - * - * @param args The arguments as a tuple. - */ - default void accept(Tuple14 args) { - accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), args.getV6(), args.getV7(), args.getV8(), args.getV9(), args.getV10(), args.getV11(), args.getV12(), args.getV13(), args.getV14()); - } - - /** - * Performs this operation on the given argument. - */ - void accept(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14); - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer13 acceptPartially(T1 v1) { - return (v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer12 acceptPartially(T1 v1, T2 v2) { - return (v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer11 acceptPartially(T1 v1, T2 v2, T3 v3) { - return (v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer10 acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4) { - return (v5, v6, v7, v8, v9, v10, v11, v12, v13, v14) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer9 acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5) { - return (v6, v7, v8, v9, v10, v11, v12, v13, v14) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer8 acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6) { - return (v7, v8, v9, v10, v11, v12, v13, v14) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer7 acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7) { - return (v8, v9, v10, v11, v12, v13, v14) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer6 acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8) { - return (v9, v10, v11, v12, v13, v14) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer5 acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9) { - return (v10, v11, v12, v13, v14) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer4 acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10) { - return (v11, v12, v13, v14) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer3 acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11) { - return (v12, v13, v14) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer2 acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12) { - return (v13, v14) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer1 acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13) { - return (v14) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer0 acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) { - return () -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer13 acceptPartially(Tuple1 args) { - return (v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14) -> accept(args.getV1(), v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer12 acceptPartially(Tuple2 args) { - return (v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14) -> accept(args.getV1(), args.getV2(), v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer11 acceptPartially(Tuple3 args) { - return (v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14) -> accept(args.getV1(), args.getV2(), args.getV3(), v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer10 acceptPartially(Tuple4 args) { - return (v5, v6, v7, v8, v9, v10, v11, v12, v13, v14) -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), v5, v6, v7, v8, v9, v10, v11, v12, v13, v14); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer9 acceptPartially(Tuple5 args) { - return (v6, v7, v8, v9, v10, v11, v12, v13, v14) -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), v6, v7, v8, v9, v10, v11, v12, v13, v14); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer8 acceptPartially(Tuple6 args) { - return (v7, v8, v9, v10, v11, v12, v13, v14) -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), args.getV6(), v7, v8, v9, v10, v11, v12, v13, v14); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer7 acceptPartially(Tuple7 args) { - return (v8, v9, v10, v11, v12, v13, v14) -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), args.getV6(), args.getV7(), v8, v9, v10, v11, v12, v13, v14); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer6 acceptPartially(Tuple8 args) { - return (v9, v10, v11, v12, v13, v14) -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), args.getV6(), args.getV7(), args.getV8(), v9, v10, v11, v12, v13, v14); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer5 acceptPartially(Tuple9 args) { - return (v10, v11, v12, v13, v14) -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), args.getV6(), args.getV7(), args.getV8(), args.getV9(), v10, v11, v12, v13, v14); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer4 acceptPartially(Tuple10 args) { - return (v11, v12, v13, v14) -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), args.getV6(), args.getV7(), args.getV8(), args.getV9(), args.getV10(), v11, v12, v13, v14); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer3 acceptPartially(Tuple11 args) { - return (v12, v13, v14) -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), args.getV6(), args.getV7(), args.getV8(), args.getV9(), args.getV10(), args.getV11(), v12, v13, v14); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer2 acceptPartially(Tuple12 args) { - return (v13, v14) -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), args.getV6(), args.getV7(), args.getV8(), args.getV9(), args.getV10(), args.getV11(), args.getV12(), v13, v14); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer1 acceptPartially(Tuple13 args) { - return (v14) -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), args.getV6(), args.getV7(), args.getV8(), args.getV9(), args.getV10(), args.getV11(), args.getV12(), args.getV13(), v14); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer0 acceptPartially(Tuple14 args) { - return () -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), args.getV6(), args.getV7(), args.getV8(), args.getV9(), args.getV10(), args.getV11(), args.getV12(), args.getV13(), args.getV14()); - } -} http://git-wip-us.apache.org/repos/asf/groovy/blob/892f67cd/src/main/groovy/groovy/util/function/Consumer15.java ---------------------------------------------------------------------- diff --git a/src/main/groovy/groovy/util/function/Consumer15.java b/src/main/groovy/groovy/util/function/Consumer15.java deleted file mode 100644 index f41095e..0000000 --- a/src/main/groovy/groovy/util/function/Consumer15.java +++ /dev/null @@ -1,269 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package groovy.util.function; - -import groovy.lang.Tuple1; -import groovy.lang.Tuple10; -import groovy.lang.Tuple11; -import groovy.lang.Tuple12; -import groovy.lang.Tuple13; -import groovy.lang.Tuple14; -import groovy.lang.Tuple15; -import groovy.lang.Tuple2; -import groovy.lang.Tuple3; -import groovy.lang.Tuple4; -import groovy.lang.Tuple5; -import groovy.lang.Tuple6; -import groovy.lang.Tuple7; -import groovy.lang.Tuple8; -import groovy.lang.Tuple9; - - -/** - * A consumer with 15 arguments. - * - * @since 3.0.0 - */ -@FunctionalInterface -public interface Consumer15 { - - /** - * Performs this operation on the given argument. - * - * @param args The arguments as a tuple. - */ - default void accept(Tuple15 args) { - accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), args.getV6(), args.getV7(), args.getV8(), args.getV9(), args.getV10(), args.getV11(), args.getV12(), args.getV13(), args.getV14(), args.getV15()); - } - - /** - * Performs this operation on the given argument. - */ - void accept(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15); - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer14 acceptPartially(T1 v1) { - return (v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer13 acceptPartially(T1 v1, T2 v2) { - return (v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer12 acceptPartially(T1 v1, T2 v2, T3 v3) { - return (v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer11 acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4) { - return (v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer10 acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5) { - return (v6, v7, v8, v9, v10, v11, v12, v13, v14, v15) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer9 acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6) { - return (v7, v8, v9, v10, v11, v12, v13, v14, v15) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer8 acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7) { - return (v8, v9, v10, v11, v12, v13, v14, v15) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer7 acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8) { - return (v9, v10, v11, v12, v13, v14, v15) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer6 acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9) { - return (v10, v11, v12, v13, v14, v15) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer5 acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10) { - return (v11, v12, v13, v14, v15) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer4 acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11) { - return (v12, v13, v14, v15) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer3 acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12) { - return (v13, v14, v15) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer2 acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13) { - return (v14, v15) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer1 acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) { - return (v15) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer0 acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) { - return () -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer14 acceptPartially(Tuple1 args) { - return (v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15) -> accept(args.getV1(), v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer13 acceptPartially(Tuple2 args) { - return (v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15) -> accept(args.getV1(), args.getV2(), v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer12 acceptPartially(Tuple3 args) { - return (v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15) -> accept(args.getV1(), args.getV2(), args.getV3(), v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer11 acceptPartially(Tuple4 args) { - return (v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15) -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer10 acceptPartially(Tuple5 args) { - return (v6, v7, v8, v9, v10, v11, v12, v13, v14, v15) -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), v6, v7, v8, v9, v10, v11, v12, v13, v14, v15); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer9 acceptPartially(Tuple6 args) { - return (v7, v8, v9, v10, v11, v12, v13, v14, v15) -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), args.getV6(), v7, v8, v9, v10, v11, v12, v13, v14, v15); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer8 acceptPartially(Tuple7 args) { - return (v8, v9, v10, v11, v12, v13, v14, v15) -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), args.getV6(), args.getV7(), v8, v9, v10, v11, v12, v13, v14, v15); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer7 acceptPartially(Tuple8 args) { - return (v9, v10, v11, v12, v13, v14, v15) -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), args.getV6(), args.getV7(), args.getV8(), v9, v10, v11, v12, v13, v14, v15); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer6 acceptPartially(Tuple9 args) { - return (v10, v11, v12, v13, v14, v15) -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), args.getV6(), args.getV7(), args.getV8(), args.getV9(), v10, v11, v12, v13, v14, v15); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer5 acceptPartially(Tuple10 args) { - return (v11, v12, v13, v14, v15) -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), args.getV6(), args.getV7(), args.getV8(), args.getV9(), args.getV10(), v11, v12, v13, v14, v15); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer4 acceptPartially(Tuple11 args) { - return (v12, v13, v14, v15) -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), args.getV6(), args.getV7(), args.getV8(), args.getV9(), args.getV10(), args.getV11(), v12, v13, v14, v15); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer3 acceptPartially(Tuple12 args) { - return (v13, v14, v15) -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), args.getV6(), args.getV7(), args.getV8(), args.getV9(), args.getV10(), args.getV11(), args.getV12(), v13, v14, v15); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer2 acceptPartially(Tuple13 args) { - return (v14, v15) -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), args.getV6(), args.getV7(), args.getV8(), args.getV9(), args.getV10(), args.getV11(), args.getV12(), args.getV13(), v14, v15); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer1 acceptPartially(Tuple14 args) { - return (v15) -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), args.getV6(), args.getV7(), args.getV8(), args.getV9(), args.getV10(), args.getV11(), args.getV12(), args.getV13(), args.getV14(), v15); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer0 acceptPartially(Tuple15 args) { - return () -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), args.getV6(), args.getV7(), args.getV8(), args.getV9(), args.getV10(), args.getV11(), args.getV12(), args.getV13(), args.getV14(), args.getV15()); - } -} http://git-wip-us.apache.org/repos/asf/groovy/blob/892f67cd/src/main/groovy/groovy/util/function/Consumer16.java ---------------------------------------------------------------------- diff --git a/src/main/groovy/groovy/util/function/Consumer16.java b/src/main/groovy/groovy/util/function/Consumer16.java deleted file mode 100644 index 60533f9..0000000 --- a/src/main/groovy/groovy/util/function/Consumer16.java +++ /dev/null @@ -1,284 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package groovy.util.function; - -import groovy.lang.Tuple1; -import groovy.lang.Tuple10; -import groovy.lang.Tuple11; -import groovy.lang.Tuple12; -import groovy.lang.Tuple13; -import groovy.lang.Tuple14; -import groovy.lang.Tuple15; -import groovy.lang.Tuple16; -import groovy.lang.Tuple2; -import groovy.lang.Tuple3; -import groovy.lang.Tuple4; -import groovy.lang.Tuple5; -import groovy.lang.Tuple6; -import groovy.lang.Tuple7; -import groovy.lang.Tuple8; -import groovy.lang.Tuple9; - - -/** - * A consumer with 16 arguments. - * - * @since 3.0.0 - */ -@FunctionalInterface -public interface Consumer16 { - - /** - * Performs this operation on the given argument. - * - * @param args The arguments as a tuple. - */ - default void accept(Tuple16 args) { - accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), args.getV6(), args.getV7(), args.getV8(), args.getV9(), args.getV10(), args.getV11(), args.getV12(), args.getV13(), args.getV14(), args.getV15(), args.getV16()); - } - - /** - * Performs this operation on the given argument. - */ - void accept(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16); - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer15 acceptPartially(T1 v1) { - return (v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer14 acceptPartially(T1 v1, T2 v2) { - return (v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer13 acceptPartially(T1 v1, T2 v2, T3 v3) { - return (v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer12 acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4) { - return (v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer11 acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5) { - return (v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer10 acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6) { - return (v7, v8, v9, v10, v11, v12, v13, v14, v15, v16) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer9 acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7) { - return (v8, v9, v10, v11, v12, v13, v14, v15, v16) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer8 acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8) { - return (v9, v10, v11, v12, v13, v14, v15, v16) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer7 acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9) { - return (v10, v11, v12, v13, v14, v15, v16) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer6 acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10) { - return (v11, v12, v13, v14, v15, v16) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer5 acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11) { - return (v12, v13, v14, v15, v16) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer4 acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12) { - return (v13, v14, v15, v16) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer3 acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13) { - return (v14, v15, v16) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer2 acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) { - return (v15, v16) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer1 acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) { - return (v16) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer0 acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16) { - return () -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer15 acceptPartially(Tuple1 args) { - return (v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16) -> accept(args.getV1(), v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer14 acceptPartially(Tuple2 args) { - return (v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16) -> accept(args.getV1(), args.getV2(), v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer13 acceptPartially(Tuple3 args) { - return (v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16) -> accept(args.getV1(), args.getV2(), args.getV3(), v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer12 acceptPartially(Tuple4 args) { - return (v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16) -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer11 acceptPartially(Tuple5 args) { - return (v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16) -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer10 acceptPartially(Tuple6 args) { - return (v7, v8, v9, v10, v11, v12, v13, v14, v15, v16) -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), args.getV6(), v7, v8, v9, v10, v11, v12, v13, v14, v15, v16); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer9 acceptPartially(Tuple7 args) { - return (v8, v9, v10, v11, v12, v13, v14, v15, v16) -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), args.getV6(), args.getV7(), v8, v9, v10, v11, v12, v13, v14, v15, v16); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer8 acceptPartially(Tuple8 args) { - return (v9, v10, v11, v12, v13, v14, v15, v16) -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), args.getV6(), args.getV7(), args.getV8(), v9, v10, v11, v12, v13, v14, v15, v16); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer7 acceptPartially(Tuple9 args) { - return (v10, v11, v12, v13, v14, v15, v16) -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), args.getV6(), args.getV7(), args.getV8(), args.getV9(), v10, v11, v12, v13, v14, v15, v16); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer6 acceptPartially(Tuple10 args) { - return (v11, v12, v13, v14, v15, v16) -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), args.getV6(), args.getV7(), args.getV8(), args.getV9(), args.getV10(), v11, v12, v13, v14, v15, v16); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer5 acceptPartially(Tuple11 args) { - return (v12, v13, v14, v15, v16) -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), args.getV6(), args.getV7(), args.getV8(), args.getV9(), args.getV10(), args.getV11(), v12, v13, v14, v15, v16); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer4 acceptPartially(Tuple12 args) { - return (v13, v14, v15, v16) -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), args.getV6(), args.getV7(), args.getV8(), args.getV9(), args.getV10(), args.getV11(), args.getV12(), v13, v14, v15, v16); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer3 acceptPartially(Tuple13 args) { - return (v14, v15, v16) -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), args.getV6(), args.getV7(), args.getV8(), args.getV9(), args.getV10(), args.getV11(), args.getV12(), args.getV13(), v14, v15, v16); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer2 acceptPartially(Tuple14 args) { - return (v15, v16) -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), args.getV6(), args.getV7(), args.getV8(), args.getV9(), args.getV10(), args.getV11(), args.getV12(), args.getV13(), args.getV14(), v15, v16); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer1 acceptPartially(Tuple15 args) { - return (v16) -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), args.getV6(), args.getV7(), args.getV8(), args.getV9(), args.getV10(), args.getV11(), args.getV12(), args.getV13(), args.getV14(), args.getV15(), v16); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer0 acceptPartially(Tuple16 args) { - return () -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), args.getV6(), args.getV7(), args.getV8(), args.getV9(), args.getV10(), args.getV11(), args.getV12(), args.getV13(), args.getV14(), args.getV15(), args.getV16()); - } -} http://git-wip-us.apache.org/repos/asf/groovy/blob/892f67cd/src/main/groovy/groovy/util/function/Consumer2.java ---------------------------------------------------------------------- diff --git a/src/main/groovy/groovy/util/function/Consumer2.java b/src/main/groovy/groovy/util/function/Consumer2.java deleted file mode 100644 index c43e512..0000000 --- a/src/main/groovy/groovy/util/function/Consumer2.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package groovy.util.function; - -import groovy.lang.Tuple1; -import groovy.lang.Tuple2; - -import java.util.function.BiConsumer; - -/** - * A consumer with 2 arguments. - * - * @since 3.0.0 - */ -@FunctionalInterface -public interface Consumer2 extends BiConsumer { - - /** - * Performs this operation on the given argument. - * - * @param args The arguments as a tuple. - */ - default void accept(Tuple2 args) { - accept(args.getV1(), args.getV2()); - } - - /** - * Performs this operation on the given argument. - */ - @Override - void accept(T1 v1, T2 v2); - - /** - * Convert this consumer to a {@link BiConsumer}. - */ - default BiConsumer toBiConsumer() { - return this::accept; - } - - /** - * Convert to this consumer to a {@link BiConsumer}. - */ - static Consumer2 from(BiConsumer consumer) { - return consumer::accept; - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer1 acceptPartially(T1 v1) { - return (v2) -> accept(v1, v2); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer0 acceptPartially(T1 v1, T2 v2) { - return () -> accept(v1, v2); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer1 acceptPartially(Tuple1 args) { - return (v2) -> accept(args.getV1(), v2); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer0 acceptPartially(Tuple2 args) { - return () -> accept(args.getV1(), args.getV2()); - } -} http://git-wip-us.apache.org/repos/asf/groovy/blob/892f67cd/src/main/groovy/groovy/util/function/Consumer3.java ---------------------------------------------------------------------- diff --git a/src/main/groovy/groovy/util/function/Consumer3.java b/src/main/groovy/groovy/util/function/Consumer3.java deleted file mode 100644 index 3411a0f..0000000 --- a/src/main/groovy/groovy/util/function/Consumer3.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package groovy.util.function; - -import groovy.lang.Tuple1; -import groovy.lang.Tuple2; -import groovy.lang.Tuple3; - - -/** - * A consumer with 3 arguments. - * - * @since 3.0.0 - */ -@FunctionalInterface -public interface Consumer3 { - - /** - * Performs this operation on the given argument. - * - * @param args The arguments as a tuple. - */ - default void accept(Tuple3 args) { - accept(args.getV1(), args.getV2(), args.getV3()); - } - - /** - * Performs this operation on the given argument. - */ - void accept(T1 v1, T2 v2, T3 v3); - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer2 acceptPartially(T1 v1) { - return (v2, v3) -> accept(v1, v2, v3); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer1 acceptPartially(T1 v1, T2 v2) { - return (v3) -> accept(v1, v2, v3); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer0 acceptPartially(T1 v1, T2 v2, T3 v3) { - return () -> accept(v1, v2, v3); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer2 acceptPartially(Tuple1 args) { - return (v2, v3) -> accept(args.getV1(), v2, v3); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer1 acceptPartially(Tuple2 args) { - return (v3) -> accept(args.getV1(), args.getV2(), v3); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer0 acceptPartially(Tuple3 args) { - return () -> accept(args.getV1(), args.getV2(), args.getV3()); - } -} http://git-wip-us.apache.org/repos/asf/groovy/blob/892f67cd/src/main/groovy/groovy/util/function/Consumer4.java ---------------------------------------------------------------------- diff --git a/src/main/groovy/groovy/util/function/Consumer4.java b/src/main/groovy/groovy/util/function/Consumer4.java deleted file mode 100644 index 234a32e..0000000 --- a/src/main/groovy/groovy/util/function/Consumer4.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package groovy.util.function; - -import groovy.lang.Tuple1; -import groovy.lang.Tuple2; -import groovy.lang.Tuple3; -import groovy.lang.Tuple4; - - -/** - * A consumer with 4 arguments. - * - * @since 3.0.0 - */ -@FunctionalInterface -public interface Consumer4 { - - /** - * Performs this operation on the given argument. - * - * @param args The arguments as a tuple. - */ - default void accept(Tuple4 args) { - accept(args.getV1(), args.getV2(), args.getV3(), args.getV4()); - } - - /** - * Performs this operation on the given argument. - */ - void accept(T1 v1, T2 v2, T3 v3, T4 v4); - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer3 acceptPartially(T1 v1) { - return (v2, v3, v4) -> accept(v1, v2, v3, v4); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer2 acceptPartially(T1 v1, T2 v2) { - return (v3, v4) -> accept(v1, v2, v3, v4); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer1 acceptPartially(T1 v1, T2 v2, T3 v3) { - return (v4) -> accept(v1, v2, v3, v4); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer0 acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4) { - return () -> accept(v1, v2, v3, v4); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer3 acceptPartially(Tuple1 args) { - return (v2, v3, v4) -> accept(args.getV1(), v2, v3, v4); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer2 acceptPartially(Tuple2 args) { - return (v3, v4) -> accept(args.getV1(), args.getV2(), v3, v4); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer1 acceptPartially(Tuple3 args) { - return (v4) -> accept(args.getV1(), args.getV2(), args.getV3(), v4); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer0 acceptPartially(Tuple4 args) { - return () -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4()); - } -} http://git-wip-us.apache.org/repos/asf/groovy/blob/892f67cd/src/main/groovy/groovy/util/function/Consumer5.java ---------------------------------------------------------------------- diff --git a/src/main/groovy/groovy/util/function/Consumer5.java b/src/main/groovy/groovy/util/function/Consumer5.java deleted file mode 100644 index 0a155cb..0000000 --- a/src/main/groovy/groovy/util/function/Consumer5.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package groovy.util.function; - -import groovy.lang.Tuple1; -import groovy.lang.Tuple2; -import groovy.lang.Tuple3; -import groovy.lang.Tuple4; -import groovy.lang.Tuple5; - - -/** - * A consumer with 5 arguments. - * - * @since 3.0.0 - */ -@FunctionalInterface -public interface Consumer5 { - - /** - * Performs this operation on the given argument. - * - * @param args The arguments as a tuple. - */ - default void accept(Tuple5 args) { - accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5()); - } - - /** - * Performs this operation on the given argument. - */ - void accept(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5); - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer4 acceptPartially(T1 v1) { - return (v2, v3, v4, v5) -> accept(v1, v2, v3, v4, v5); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer3 acceptPartially(T1 v1, T2 v2) { - return (v3, v4, v5) -> accept(v1, v2, v3, v4, v5); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer2 acceptPartially(T1 v1, T2 v2, T3 v3) { - return (v4, v5) -> accept(v1, v2, v3, v4, v5); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer1 acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4) { - return (v5) -> accept(v1, v2, v3, v4, v5); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer0 acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5) { - return () -> accept(v1, v2, v3, v4, v5); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer4 acceptPartially(Tuple1 args) { - return (v2, v3, v4, v5) -> accept(args.getV1(), v2, v3, v4, v5); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer3 acceptPartially(Tuple2 args) { - return (v3, v4, v5) -> accept(args.getV1(), args.getV2(), v3, v4, v5); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer2 acceptPartially(Tuple3 args) { - return (v4, v5) -> accept(args.getV1(), args.getV2(), args.getV3(), v4, v5); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer1 acceptPartially(Tuple4 args) { - return (v5) -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), v5); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer0 acceptPartially(Tuple5 args) { - return () -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5()); - } -} http://git-wip-us.apache.org/repos/asf/groovy/blob/892f67cd/src/main/groovy/groovy/util/function/Consumer6.java ---------------------------------------------------------------------- diff --git a/src/main/groovy/groovy/util/function/Consumer6.java b/src/main/groovy/groovy/util/function/Consumer6.java deleted file mode 100644 index 2bb13c0..0000000 --- a/src/main/groovy/groovy/util/function/Consumer6.java +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package groovy.util.function; - -import groovy.lang.Tuple1; -import groovy.lang.Tuple2; -import groovy.lang.Tuple3; -import groovy.lang.Tuple4; -import groovy.lang.Tuple5; -import groovy.lang.Tuple6; - - -/** - * A consumer with 6 arguments. - * - * @since 3.0.0 - */ -@FunctionalInterface -public interface Consumer6 { - - /** - * Performs this operation on the given argument. - * - * @param args The arguments as a tuple. - */ - default void accept(Tuple6 args) { - accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), args.getV6()); - } - - /** - * Performs this operation on the given argument. - */ - void accept(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6); - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer5 acceptPartially(T1 v1) { - return (v2, v3, v4, v5, v6) -> accept(v1, v2, v3, v4, v5, v6); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer4 acceptPartially(T1 v1, T2 v2) { - return (v3, v4, v5, v6) -> accept(v1, v2, v3, v4, v5, v6); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer3 acceptPartially(T1 v1, T2 v2, T3 v3) { - return (v4, v5, v6) -> accept(v1, v2, v3, v4, v5, v6); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer2 acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4) { - return (v5, v6) -> accept(v1, v2, v3, v4, v5, v6); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer1 acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5) { - return (v6) -> accept(v1, v2, v3, v4, v5, v6); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer0 acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6) { - return () -> accept(v1, v2, v3, v4, v5, v6); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer5 acceptPartially(Tuple1 args) { - return (v2, v3, v4, v5, v6) -> accept(args.getV1(), v2, v3, v4, v5, v6); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer4 acceptPartially(Tuple2 args) { - return (v3, v4, v5, v6) -> accept(args.getV1(), args.getV2(), v3, v4, v5, v6); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer3 acceptPartially(Tuple3 args) { - return (v4, v5, v6) -> accept(args.getV1(), args.getV2(), args.getV3(), v4, v5, v6); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer2 acceptPartially(Tuple4 args) { - return (v5, v6) -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), v5, v6); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer1 acceptPartially(Tuple5 args) { - return (v6) -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), v6); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer0 acceptPartially(Tuple6 args) { - return () -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), args.getV6()); - } -} http://git-wip-us.apache.org/repos/asf/groovy/blob/892f67cd/src/main/groovy/groovy/util/function/Consumer7.java ---------------------------------------------------------------------- diff --git a/src/main/groovy/groovy/util/function/Consumer7.java b/src/main/groovy/groovy/util/function/Consumer7.java deleted file mode 100644 index 05b4632..0000000 --- a/src/main/groovy/groovy/util/function/Consumer7.java +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package groovy.util.function; - -import groovy.lang.Tuple1; -import groovy.lang.Tuple2; -import groovy.lang.Tuple3; -import groovy.lang.Tuple4; -import groovy.lang.Tuple5; -import groovy.lang.Tuple6; -import groovy.lang.Tuple7; - - -/** - * A consumer with 7 arguments. - * - * @since 3.0.0 - */ -@FunctionalInterface -public interface Consumer7 { - - /** - * Performs this operation on the given argument. - * - * @param args The arguments as a tuple. - */ - default void accept(Tuple7 args) { - accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), args.getV6(), args.getV7()); - } - - /** - * Performs this operation on the given argument. - */ - void accept(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7); - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer6 acceptPartially(T1 v1) { - return (v2, v3, v4, v5, v6, v7) -> accept(v1, v2, v3, v4, v5, v6, v7); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer5 acceptPartially(T1 v1, T2 v2) { - return (v3, v4, v5, v6, v7) -> accept(v1, v2, v3, v4, v5, v6, v7); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer4 acceptPartially(T1 v1, T2 v2, T3 v3) { - return (v4, v5, v6, v7) -> accept(v1, v2, v3, v4, v5, v6, v7); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer3 acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4) { - return (v5, v6, v7) -> accept(v1, v2, v3, v4, v5, v6, v7); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer2 acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5) { - return (v6, v7) -> accept(v1, v2, v3, v4, v5, v6, v7); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer1 acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6) { - return (v7) -> accept(v1, v2, v3, v4, v5, v6, v7); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer0 acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7) { - return () -> accept(v1, v2, v3, v4, v5, v6, v7); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer6 acceptPartially(Tuple1 args) { - return (v2, v3, v4, v5, v6, v7) -> accept(args.getV1(), v2, v3, v4, v5, v6, v7); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer5 acceptPartially(Tuple2 args) { - return (v3, v4, v5, v6, v7) -> accept(args.getV1(), args.getV2(), v3, v4, v5, v6, v7); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer4 acceptPartially(Tuple3 args) { - return (v4, v5, v6, v7) -> accept(args.getV1(), args.getV2(), args.getV3(), v4, v5, v6, v7); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer3 acceptPartially(Tuple4 args) { - return (v5, v6, v7) -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), v5, v6, v7); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer2 acceptPartially(Tuple5 args) { - return (v6, v7) -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), v6, v7); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer1 acceptPartially(Tuple6 args) { - return (v7) -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), args.getV6(), v7); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer0 acceptPartially(Tuple7 args) { - return () -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), args.getV6(), args.getV7()); - } -}