http://git-wip-us.apache.org/repos/asf/flink/blob/7081836e/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple15Builder.java
----------------------------------------------------------------------
diff --git 
a/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple15Builder.java
 
b/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple15Builder.java
new file mode 100644
index 0000000..2ab1d0a
--- /dev/null
+++ 
b/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple15Builder.java
@@ -0,0 +1,46 @@
+/*
+ * 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.
+ */
+
+
+// --------------------------------------------------------------
+//  THIS IS A GENERATED SOURCE FILE. DO NOT EDIT!
+//  GENERATED FROM org.apache.flink.api.java.tuple.TupleGenerator.
+// --------------------------------------------------------------
+
+
+package org.apache.flink.api.java.tuple.builder;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.flink.api.java.tuple.Tuple15;
+
+public class Tuple15Builder<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, 
T12, T13, T14> {
+
+       private List<Tuple15<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, 
T12, T13, T14>> tuples = new ArrayList<>();
+
+       public Tuple15Builder<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, 
T12, T13, T14> add(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 
value5, T6 value6, T7 value7, T8 value8, T9 value9, T10 value10, T11 value11, 
T12 value12, T13 value13, T14 value14){
+               tuples.add(new Tuple15<>(value0, value1, value2, value3, 
value4, value5, value6, value7, value8, value9, value10, value11, value12, 
value13, value14));
+               return this;
+       }
+
+       @SuppressWarnings("unchecked")
+       public Tuple15<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, 
T13, T14>[] build(){
+               return tuples.toArray(new Tuple15[tuples.size()]);
+       }
+}

http://git-wip-us.apache.org/repos/asf/flink/blob/7081836e/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple16Builder.java
----------------------------------------------------------------------
diff --git 
a/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple16Builder.java
 
b/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple16Builder.java
new file mode 100644
index 0000000..5b4fba2
--- /dev/null
+++ 
b/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple16Builder.java
@@ -0,0 +1,46 @@
+/*
+ * 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.
+ */
+
+
+// --------------------------------------------------------------
+//  THIS IS A GENERATED SOURCE FILE. DO NOT EDIT!
+//  GENERATED FROM org.apache.flink.api.java.tuple.TupleGenerator.
+// --------------------------------------------------------------
+
+
+package org.apache.flink.api.java.tuple.builder;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.flink.api.java.tuple.Tuple16;
+
+public class Tuple16Builder<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, 
T12, T13, T14, T15> {
+
+       private List<Tuple16<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, 
T12, T13, T14, T15>> tuples = new ArrayList<>();
+
+       public Tuple16Builder<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, 
T12, T13, T14, T15> add(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, 
T5 value5, T6 value6, T7 value7, T8 value8, T9 value9, T10 value10, T11 
value11, T12 value12, T13 value13, T14 value14, T15 value15){
+               tuples.add(new Tuple16<>(value0, value1, value2, value3, 
value4, value5, value6, value7, value8, value9, value10, value11, value12, 
value13, value14, value15));
+               return this;
+       }
+
+       @SuppressWarnings("unchecked")
+       public Tuple16<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, 
T13, T14, T15>[] build(){
+               return tuples.toArray(new Tuple16[tuples.size()]);
+       }
+}

http://git-wip-us.apache.org/repos/asf/flink/blob/7081836e/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple17Builder.java
----------------------------------------------------------------------
diff --git 
a/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple17Builder.java
 
b/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple17Builder.java
new file mode 100644
index 0000000..68ba92b
--- /dev/null
+++ 
b/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple17Builder.java
@@ -0,0 +1,46 @@
+/*
+ * 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.
+ */
+
+
+// --------------------------------------------------------------
+//  THIS IS A GENERATED SOURCE FILE. DO NOT EDIT!
+//  GENERATED FROM org.apache.flink.api.java.tuple.TupleGenerator.
+// --------------------------------------------------------------
+
+
+package org.apache.flink.api.java.tuple.builder;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.flink.api.java.tuple.Tuple17;
+
+public class Tuple17Builder<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, 
T12, T13, T14, T15, T16> {
+
+       private List<Tuple17<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, 
T12, T13, T14, T15, T16>> tuples = new ArrayList<>();
+
+       public Tuple17Builder<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, 
T12, T13, T14, T15, T16> add(T0 value0, T1 value1, T2 value2, T3 value3, T4 
value4, T5 value5, T6 value6, T7 value7, T8 value8, T9 value9, T10 value10, T11 
value11, T12 value12, T13 value13, T14 value14, T15 value15, T16 value16){
+               tuples.add(new Tuple17<>(value0, value1, value2, value3, 
value4, value5, value6, value7, value8, value9, value10, value11, value12, 
value13, value14, value15, value16));
+               return this;
+       }
+
+       @SuppressWarnings("unchecked")
+       public Tuple17<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, 
T13, T14, T15, T16>[] build(){
+               return tuples.toArray(new Tuple17[tuples.size()]);
+       }
+}

http://git-wip-us.apache.org/repos/asf/flink/blob/7081836e/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple18Builder.java
----------------------------------------------------------------------
diff --git 
a/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple18Builder.java
 
b/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple18Builder.java
new file mode 100644
index 0000000..d4ee37c
--- /dev/null
+++ 
b/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple18Builder.java
@@ -0,0 +1,46 @@
+/*
+ * 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.
+ */
+
+
+// --------------------------------------------------------------
+//  THIS IS A GENERATED SOURCE FILE. DO NOT EDIT!
+//  GENERATED FROM org.apache.flink.api.java.tuple.TupleGenerator.
+// --------------------------------------------------------------
+
+
+package org.apache.flink.api.java.tuple.builder;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.flink.api.java.tuple.Tuple18;
+
+public class Tuple18Builder<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, 
T12, T13, T14, T15, T16, T17> {
+
+       private List<Tuple18<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, 
T12, T13, T14, T15, T16, T17>> tuples = new ArrayList<>();
+
+       public Tuple18Builder<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, 
T12, T13, T14, T15, T16, T17> add(T0 value0, T1 value1, T2 value2, T3 value3, 
T4 value4, T5 value5, T6 value6, T7 value7, T8 value8, T9 value9, T10 value10, 
T11 value11, T12 value12, T13 value13, T14 value14, T15 value15, T16 value16, 
T17 value17){
+               tuples.add(new Tuple18<>(value0, value1, value2, value3, 
value4, value5, value6, value7, value8, value9, value10, value11, value12, 
value13, value14, value15, value16, value17));
+               return this;
+       }
+
+       @SuppressWarnings("unchecked")
+       public Tuple18<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, 
T13, T14, T15, T16, T17>[] build(){
+               return tuples.toArray(new Tuple18[tuples.size()]);
+       }
+}

http://git-wip-us.apache.org/repos/asf/flink/blob/7081836e/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple19Builder.java
----------------------------------------------------------------------
diff --git 
a/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple19Builder.java
 
b/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple19Builder.java
new file mode 100644
index 0000000..baf00ce
--- /dev/null
+++ 
b/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple19Builder.java
@@ -0,0 +1,46 @@
+/*
+ * 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.
+ */
+
+
+// --------------------------------------------------------------
+//  THIS IS A GENERATED SOURCE FILE. DO NOT EDIT!
+//  GENERATED FROM org.apache.flink.api.java.tuple.TupleGenerator.
+// --------------------------------------------------------------
+
+
+package org.apache.flink.api.java.tuple.builder;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.flink.api.java.tuple.Tuple19;
+
+public class Tuple19Builder<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, 
T12, T13, T14, T15, T16, T17, T18> {
+
+       private List<Tuple19<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, 
T12, T13, T14, T15, T16, T17, T18>> tuples = new ArrayList<>();
+
+       public Tuple19Builder<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, 
T12, T13, T14, T15, T16, T17, T18> add(T0 value0, T1 value1, T2 value2, T3 
value3, T4 value4, T5 value5, T6 value6, T7 value7, T8 value8, T9 value9, T10 
value10, T11 value11, T12 value12, T13 value13, T14 value14, T15 value15, T16 
value16, T17 value17, T18 value18){
+               tuples.add(new Tuple19<>(value0, value1, value2, value3, 
value4, value5, value6, value7, value8, value9, value10, value11, value12, 
value13, value14, value15, value16, value17, value18));
+               return this;
+       }
+
+       @SuppressWarnings("unchecked")
+       public Tuple19<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, 
T13, T14, T15, T16, T17, T18>[] build(){
+               return tuples.toArray(new Tuple19[tuples.size()]);
+       }
+}

http://git-wip-us.apache.org/repos/asf/flink/blob/7081836e/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple1Builder.java
----------------------------------------------------------------------
diff --git 
a/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple1Builder.java
 
b/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple1Builder.java
new file mode 100644
index 0000000..f16a9d1
--- /dev/null
+++ 
b/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple1Builder.java
@@ -0,0 +1,46 @@
+/*
+ * 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.
+ */
+
+
+// --------------------------------------------------------------
+//  THIS IS A GENERATED SOURCE FILE. DO NOT EDIT!
+//  GENERATED FROM org.apache.flink.api.java.tuple.TupleGenerator.
+// --------------------------------------------------------------
+
+
+package org.apache.flink.api.java.tuple.builder;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.flink.api.java.tuple.Tuple1;
+
+public class Tuple1Builder<T0> {
+
+       private List<Tuple1<T0>> tuples = new ArrayList<>();
+
+       public Tuple1Builder<T0> add(T0 value0){
+               tuples.add(new Tuple1<>(value0));
+               return this;
+       }
+
+       @SuppressWarnings("unchecked")
+       public Tuple1<T0>[] build(){
+               return tuples.toArray(new Tuple1[tuples.size()]);
+       }
+}

http://git-wip-us.apache.org/repos/asf/flink/blob/7081836e/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple20Builder.java
----------------------------------------------------------------------
diff --git 
a/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple20Builder.java
 
b/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple20Builder.java
new file mode 100644
index 0000000..41bb974
--- /dev/null
+++ 
b/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple20Builder.java
@@ -0,0 +1,46 @@
+/*
+ * 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.
+ */
+
+
+// --------------------------------------------------------------
+//  THIS IS A GENERATED SOURCE FILE. DO NOT EDIT!
+//  GENERATED FROM org.apache.flink.api.java.tuple.TupleGenerator.
+// --------------------------------------------------------------
+
+
+package org.apache.flink.api.java.tuple.builder;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.flink.api.java.tuple.Tuple20;
+
+public class Tuple20Builder<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, 
T12, T13, T14, T15, T16, T17, T18, T19> {
+
+       private List<Tuple20<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, 
T12, T13, T14, T15, T16, T17, T18, T19>> tuples = new ArrayList<>();
+
+       public Tuple20Builder<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, 
T12, T13, T14, T15, T16, T17, T18, T19> add(T0 value0, T1 value1, T2 value2, T3 
value3, T4 value4, T5 value5, T6 value6, T7 value7, T8 value8, T9 value9, T10 
value10, T11 value11, T12 value12, T13 value13, T14 value14, T15 value15, T16 
value16, T17 value17, T18 value18, T19 value19){
+               tuples.add(new Tuple20<>(value0, value1, value2, value3, 
value4, value5, value6, value7, value8, value9, value10, value11, value12, 
value13, value14, value15, value16, value17, value18, value19));
+               return this;
+       }
+
+       @SuppressWarnings("unchecked")
+       public Tuple20<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, 
T13, T14, T15, T16, T17, T18, T19>[] build(){
+               return tuples.toArray(new Tuple20[tuples.size()]);
+       }
+}

http://git-wip-us.apache.org/repos/asf/flink/blob/7081836e/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple21Builder.java
----------------------------------------------------------------------
diff --git 
a/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple21Builder.java
 
b/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple21Builder.java
new file mode 100644
index 0000000..f24b7ec
--- /dev/null
+++ 
b/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple21Builder.java
@@ -0,0 +1,46 @@
+/*
+ * 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.
+ */
+
+
+// --------------------------------------------------------------
+//  THIS IS A GENERATED SOURCE FILE. DO NOT EDIT!
+//  GENERATED FROM org.apache.flink.api.java.tuple.TupleGenerator.
+// --------------------------------------------------------------
+
+
+package org.apache.flink.api.java.tuple.builder;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.flink.api.java.tuple.Tuple21;
+
+public class Tuple21Builder<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, 
T12, T13, T14, T15, T16, T17, T18, T19, T20> {
+
+       private List<Tuple21<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, 
T12, T13, T14, T15, T16, T17, T18, T19, T20>> tuples = new ArrayList<>();
+
+       public Tuple21Builder<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, 
T12, T13, T14, T15, T16, T17, T18, T19, T20> add(T0 value0, T1 value1, T2 
value2, T3 value3, T4 value4, T5 value5, T6 value6, T7 value7, T8 value8, T9 
value9, T10 value10, T11 value11, T12 value12, T13 value13, T14 value14, T15 
value15, T16 value16, T17 value17, T18 value18, T19 value19, T20 value20){
+               tuples.add(new Tuple21<>(value0, value1, value2, value3, 
value4, value5, value6, value7, value8, value9, value10, value11, value12, 
value13, value14, value15, value16, value17, value18, value19, value20));
+               return this;
+       }
+
+       @SuppressWarnings("unchecked")
+       public Tuple21<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, 
T13, T14, T15, T16, T17, T18, T19, T20>[] build(){
+               return tuples.toArray(new Tuple21[tuples.size()]);
+       }
+}

http://git-wip-us.apache.org/repos/asf/flink/blob/7081836e/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple22Builder.java
----------------------------------------------------------------------
diff --git 
a/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple22Builder.java
 
b/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple22Builder.java
new file mode 100644
index 0000000..710fe50
--- /dev/null
+++ 
b/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple22Builder.java
@@ -0,0 +1,46 @@
+/*
+ * 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.
+ */
+
+
+// --------------------------------------------------------------
+//  THIS IS A GENERATED SOURCE FILE. DO NOT EDIT!
+//  GENERATED FROM org.apache.flink.api.java.tuple.TupleGenerator.
+// --------------------------------------------------------------
+
+
+package org.apache.flink.api.java.tuple.builder;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.flink.api.java.tuple.Tuple22;
+
+public class Tuple22Builder<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, 
T12, T13, T14, T15, T16, T17, T18, T19, T20, T21> {
+
+       private List<Tuple22<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, 
T12, T13, T14, T15, T16, T17, T18, T19, T20, T21>> tuples = new ArrayList<>();
+
+       public Tuple22Builder<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, 
T12, T13, T14, T15, T16, T17, T18, T19, T20, T21> add(T0 value0, T1 value1, T2 
value2, T3 value3, T4 value4, T5 value5, T6 value6, T7 value7, T8 value8, T9 
value9, T10 value10, T11 value11, T12 value12, T13 value13, T14 value14, T15 
value15, T16 value16, T17 value17, T18 value18, T19 value19, T20 value20, T21 
value21){
+               tuples.add(new Tuple22<>(value0, value1, value2, value3, 
value4, value5, value6, value7, value8, value9, value10, value11, value12, 
value13, value14, value15, value16, value17, value18, value19, value20, 
value21));
+               return this;
+       }
+
+       @SuppressWarnings("unchecked")
+       public Tuple22<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, 
T13, T14, T15, T16, T17, T18, T19, T20, T21>[] build(){
+               return tuples.toArray(new Tuple22[tuples.size()]);
+       }
+}

http://git-wip-us.apache.org/repos/asf/flink/blob/7081836e/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple23Builder.java
----------------------------------------------------------------------
diff --git 
a/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple23Builder.java
 
b/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple23Builder.java
new file mode 100644
index 0000000..a81e6c1
--- /dev/null
+++ 
b/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple23Builder.java
@@ -0,0 +1,46 @@
+/*
+ * 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.
+ */
+
+
+// --------------------------------------------------------------
+//  THIS IS A GENERATED SOURCE FILE. DO NOT EDIT!
+//  GENERATED FROM org.apache.flink.api.java.tuple.TupleGenerator.
+// --------------------------------------------------------------
+
+
+package org.apache.flink.api.java.tuple.builder;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.flink.api.java.tuple.Tuple23;
+
+public class Tuple23Builder<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, 
T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22> {
+
+       private List<Tuple23<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, 
T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22>> tuples = new 
ArrayList<>();
+
+       public Tuple23Builder<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, 
T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22> add(T0 value0, T1 
value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6, T7 value7, T8 
value8, T9 value9, T10 value10, T11 value11, T12 value12, T13 value13, T14 
value14, T15 value15, T16 value16, T17 value17, T18 value18, T19 value19, T20 
value20, T21 value21, T22 value22){
+               tuples.add(new Tuple23<>(value0, value1, value2, value3, 
value4, value5, value6, value7, value8, value9, value10, value11, value12, 
value13, value14, value15, value16, value17, value18, value19, value20, 
value21, value22));
+               return this;
+       }
+
+       @SuppressWarnings("unchecked")
+       public Tuple23<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, 
T13, T14, T15, T16, T17, T18, T19, T20, T21, T22>[] build(){
+               return tuples.toArray(new Tuple23[tuples.size()]);
+       }
+}

http://git-wip-us.apache.org/repos/asf/flink/blob/7081836e/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple24Builder.java
----------------------------------------------------------------------
diff --git 
a/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple24Builder.java
 
b/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple24Builder.java
new file mode 100644
index 0000000..2b6fa4c
--- /dev/null
+++ 
b/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple24Builder.java
@@ -0,0 +1,46 @@
+/*
+ * 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.
+ */
+
+
+// --------------------------------------------------------------
+//  THIS IS A GENERATED SOURCE FILE. DO NOT EDIT!
+//  GENERATED FROM org.apache.flink.api.java.tuple.TupleGenerator.
+// --------------------------------------------------------------
+
+
+package org.apache.flink.api.java.tuple.builder;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.flink.api.java.tuple.Tuple24;
+
+public class Tuple24Builder<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, 
T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> {
+
+       private List<Tuple24<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, 
T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23>> tuples = new 
ArrayList<>();
+
+       public Tuple24Builder<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, 
T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> add(T0 value0, T1 
value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6, T7 value7, T8 
value8, T9 value9, T10 value10, T11 value11, T12 value12, T13 value13, T14 
value14, T15 value15, T16 value16, T17 value17, T18 value18, T19 value19, T20 
value20, T21 value21, T22 value22, T23 value23){
+               tuples.add(new Tuple24<>(value0, value1, value2, value3, 
value4, value5, value6, value7, value8, value9, value10, value11, value12, 
value13, value14, value15, value16, value17, value18, value19, value20, 
value21, value22, value23));
+               return this;
+       }
+
+       @SuppressWarnings("unchecked")
+       public Tuple24<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, 
T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23>[] build(){
+               return tuples.toArray(new Tuple24[tuples.size()]);
+       }
+}

http://git-wip-us.apache.org/repos/asf/flink/blob/7081836e/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple25Builder.java
----------------------------------------------------------------------
diff --git 
a/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple25Builder.java
 
b/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple25Builder.java
new file mode 100644
index 0000000..2ab94fb
--- /dev/null
+++ 
b/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple25Builder.java
@@ -0,0 +1,46 @@
+/*
+ * 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.
+ */
+
+
+// --------------------------------------------------------------
+//  THIS IS A GENERATED SOURCE FILE. DO NOT EDIT!
+//  GENERATED FROM org.apache.flink.api.java.tuple.TupleGenerator.
+// --------------------------------------------------------------
+
+
+package org.apache.flink.api.java.tuple.builder;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.flink.api.java.tuple.Tuple25;
+
+public class Tuple25Builder<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, 
T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> {
+
+       private List<Tuple25<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, 
T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24>> tuples = new 
ArrayList<>();
+
+       public Tuple25Builder<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, 
T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> add(T0 value0, 
T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6, T7 value7, T8 
value8, T9 value9, T10 value10, T11 value11, T12 value12, T13 value13, T14 
value14, T15 value15, T16 value16, T17 value17, T18 value18, T19 value19, T20 
value20, T21 value21, T22 value22, T23 value23, T24 value24){
+               tuples.add(new Tuple25<>(value0, value1, value2, value3, 
value4, value5, value6, value7, value8, value9, value10, value11, value12, 
value13, value14, value15, value16, value17, value18, value19, value20, 
value21, value22, value23, value24));
+               return this;
+       }
+
+       @SuppressWarnings("unchecked")
+       public Tuple25<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, 
T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24>[] build(){
+               return tuples.toArray(new Tuple25[tuples.size()]);
+       }
+}

http://git-wip-us.apache.org/repos/asf/flink/blob/7081836e/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple2Builder.java
----------------------------------------------------------------------
diff --git 
a/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple2Builder.java
 
b/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple2Builder.java
new file mode 100644
index 0000000..aa8ad9e
--- /dev/null
+++ 
b/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple2Builder.java
@@ -0,0 +1,46 @@
+/*
+ * 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.
+ */
+
+
+// --------------------------------------------------------------
+//  THIS IS A GENERATED SOURCE FILE. DO NOT EDIT!
+//  GENERATED FROM org.apache.flink.api.java.tuple.TupleGenerator.
+// --------------------------------------------------------------
+
+
+package org.apache.flink.api.java.tuple.builder;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.flink.api.java.tuple.Tuple2;
+
+public class Tuple2Builder<T0, T1> {
+
+       private List<Tuple2<T0, T1>> tuples = new ArrayList<>();
+
+       public Tuple2Builder<T0, T1> add(T0 value0, T1 value1){
+               tuples.add(new Tuple2<>(value0, value1));
+               return this;
+       }
+
+       @SuppressWarnings("unchecked")
+       public Tuple2<T0, T1>[] build(){
+               return tuples.toArray(new Tuple2[tuples.size()]);
+       }
+}

http://git-wip-us.apache.org/repos/asf/flink/blob/7081836e/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple3Builder.java
----------------------------------------------------------------------
diff --git 
a/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple3Builder.java
 
b/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple3Builder.java
new file mode 100644
index 0000000..024c3c9
--- /dev/null
+++ 
b/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple3Builder.java
@@ -0,0 +1,46 @@
+/*
+ * 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.
+ */
+
+
+// --------------------------------------------------------------
+//  THIS IS A GENERATED SOURCE FILE. DO NOT EDIT!
+//  GENERATED FROM org.apache.flink.api.java.tuple.TupleGenerator.
+// --------------------------------------------------------------
+
+
+package org.apache.flink.api.java.tuple.builder;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.flink.api.java.tuple.Tuple3;
+
+public class Tuple3Builder<T0, T1, T2> {
+
+       private List<Tuple3<T0, T1, T2>> tuples = new ArrayList<>();
+
+       public Tuple3Builder<T0, T1, T2> add(T0 value0, T1 value1, T2 value2){
+               tuples.add(new Tuple3<>(value0, value1, value2));
+               return this;
+       }
+
+       @SuppressWarnings("unchecked")
+       public Tuple3<T0, T1, T2>[] build(){
+               return tuples.toArray(new Tuple3[tuples.size()]);
+       }
+}

http://git-wip-us.apache.org/repos/asf/flink/blob/7081836e/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple4Builder.java
----------------------------------------------------------------------
diff --git 
a/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple4Builder.java
 
b/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple4Builder.java
new file mode 100644
index 0000000..f889dcb
--- /dev/null
+++ 
b/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple4Builder.java
@@ -0,0 +1,46 @@
+/*
+ * 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.
+ */
+
+
+// --------------------------------------------------------------
+//  THIS IS A GENERATED SOURCE FILE. DO NOT EDIT!
+//  GENERATED FROM org.apache.flink.api.java.tuple.TupleGenerator.
+// --------------------------------------------------------------
+
+
+package org.apache.flink.api.java.tuple.builder;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.flink.api.java.tuple.Tuple4;
+
+public class Tuple4Builder<T0, T1, T2, T3> {
+
+       private List<Tuple4<T0, T1, T2, T3>> tuples = new ArrayList<>();
+
+       public Tuple4Builder<T0, T1, T2, T3> add(T0 value0, T1 value1, T2 
value2, T3 value3){
+               tuples.add(new Tuple4<>(value0, value1, value2, value3));
+               return this;
+       }
+
+       @SuppressWarnings("unchecked")
+       public Tuple4<T0, T1, T2, T3>[] build(){
+               return tuples.toArray(new Tuple4[tuples.size()]);
+       }
+}

http://git-wip-us.apache.org/repos/asf/flink/blob/7081836e/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple5Builder.java
----------------------------------------------------------------------
diff --git 
a/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple5Builder.java
 
b/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple5Builder.java
new file mode 100644
index 0000000..9f0725c
--- /dev/null
+++ 
b/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple5Builder.java
@@ -0,0 +1,46 @@
+/*
+ * 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.
+ */
+
+
+// --------------------------------------------------------------
+//  THIS IS A GENERATED SOURCE FILE. DO NOT EDIT!
+//  GENERATED FROM org.apache.flink.api.java.tuple.TupleGenerator.
+// --------------------------------------------------------------
+
+
+package org.apache.flink.api.java.tuple.builder;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.flink.api.java.tuple.Tuple5;
+
+public class Tuple5Builder<T0, T1, T2, T3, T4> {
+
+       private List<Tuple5<T0, T1, T2, T3, T4>> tuples = new ArrayList<>();
+
+       public Tuple5Builder<T0, T1, T2, T3, T4> add(T0 value0, T1 value1, T2 
value2, T3 value3, T4 value4){
+               tuples.add(new Tuple5<>(value0, value1, value2, value3, 
value4));
+               return this;
+       }
+
+       @SuppressWarnings("unchecked")
+       public Tuple5<T0, T1, T2, T3, T4>[] build(){
+               return tuples.toArray(new Tuple5[tuples.size()]);
+       }
+}

http://git-wip-us.apache.org/repos/asf/flink/blob/7081836e/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple6Builder.java
----------------------------------------------------------------------
diff --git 
a/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple6Builder.java
 
b/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple6Builder.java
new file mode 100644
index 0000000..2320fdd
--- /dev/null
+++ 
b/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple6Builder.java
@@ -0,0 +1,46 @@
+/*
+ * 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.
+ */
+
+
+// --------------------------------------------------------------
+//  THIS IS A GENERATED SOURCE FILE. DO NOT EDIT!
+//  GENERATED FROM org.apache.flink.api.java.tuple.TupleGenerator.
+// --------------------------------------------------------------
+
+
+package org.apache.flink.api.java.tuple.builder;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.flink.api.java.tuple.Tuple6;
+
+public class Tuple6Builder<T0, T1, T2, T3, T4, T5> {
+
+       private List<Tuple6<T0, T1, T2, T3, T4, T5>> tuples = new ArrayList<>();
+
+       public Tuple6Builder<T0, T1, T2, T3, T4, T5> add(T0 value0, T1 value1, 
T2 value2, T3 value3, T4 value4, T5 value5){
+               tuples.add(new Tuple6<>(value0, value1, value2, value3, value4, 
value5));
+               return this;
+       }
+
+       @SuppressWarnings("unchecked")
+       public Tuple6<T0, T1, T2, T3, T4, T5>[] build(){
+               return tuples.toArray(new Tuple6[tuples.size()]);
+       }
+}

http://git-wip-us.apache.org/repos/asf/flink/blob/7081836e/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple7Builder.java
----------------------------------------------------------------------
diff --git 
a/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple7Builder.java
 
b/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple7Builder.java
new file mode 100644
index 0000000..278526b
--- /dev/null
+++ 
b/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple7Builder.java
@@ -0,0 +1,46 @@
+/*
+ * 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.
+ */
+
+
+// --------------------------------------------------------------
+//  THIS IS A GENERATED SOURCE FILE. DO NOT EDIT!
+//  GENERATED FROM org.apache.flink.api.java.tuple.TupleGenerator.
+// --------------------------------------------------------------
+
+
+package org.apache.flink.api.java.tuple.builder;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.flink.api.java.tuple.Tuple7;
+
+public class Tuple7Builder<T0, T1, T2, T3, T4, T5, T6> {
+
+       private List<Tuple7<T0, T1, T2, T3, T4, T5, T6>> tuples = new 
ArrayList<>();
+
+       public Tuple7Builder<T0, T1, T2, T3, T4, T5, T6> add(T0 value0, T1 
value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6){
+               tuples.add(new Tuple7<>(value0, value1, value2, value3, value4, 
value5, value6));
+               return this;
+       }
+
+       @SuppressWarnings("unchecked")
+       public Tuple7<T0, T1, T2, T3, T4, T5, T6>[] build(){
+               return tuples.toArray(new Tuple7[tuples.size()]);
+       }
+}

http://git-wip-us.apache.org/repos/asf/flink/blob/7081836e/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple8Builder.java
----------------------------------------------------------------------
diff --git 
a/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple8Builder.java
 
b/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple8Builder.java
new file mode 100644
index 0000000..e09acde
--- /dev/null
+++ 
b/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple8Builder.java
@@ -0,0 +1,46 @@
+/*
+ * 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.
+ */
+
+
+// --------------------------------------------------------------
+//  THIS IS A GENERATED SOURCE FILE. DO NOT EDIT!
+//  GENERATED FROM org.apache.flink.api.java.tuple.TupleGenerator.
+// --------------------------------------------------------------
+
+
+package org.apache.flink.api.java.tuple.builder;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.flink.api.java.tuple.Tuple8;
+
+public class Tuple8Builder<T0, T1, T2, T3, T4, T5, T6, T7> {
+
+       private List<Tuple8<T0, T1, T2, T3, T4, T5, T6, T7>> tuples = new 
ArrayList<>();
+
+       public Tuple8Builder<T0, T1, T2, T3, T4, T5, T6, T7> add(T0 value0, T1 
value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6, T7 value7){
+               tuples.add(new Tuple8<>(value0, value1, value2, value3, value4, 
value5, value6, value7));
+               return this;
+       }
+
+       @SuppressWarnings("unchecked")
+       public Tuple8<T0, T1, T2, T3, T4, T5, T6, T7>[] build(){
+               return tuples.toArray(new Tuple8[tuples.size()]);
+       }
+}

http://git-wip-us.apache.org/repos/asf/flink/blob/7081836e/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple9Builder.java
----------------------------------------------------------------------
diff --git 
a/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple9Builder.java
 
b/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple9Builder.java
new file mode 100644
index 0000000..cea4e41
--- /dev/null
+++ 
b/flink-core/src/main/java/org/apache/flink/api/java/tuple/builder/Tuple9Builder.java
@@ -0,0 +1,46 @@
+/*
+ * 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.
+ */
+
+
+// --------------------------------------------------------------
+//  THIS IS A GENERATED SOURCE FILE. DO NOT EDIT!
+//  GENERATED FROM org.apache.flink.api.java.tuple.TupleGenerator.
+// --------------------------------------------------------------
+
+
+package org.apache.flink.api.java.tuple.builder;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.flink.api.java.tuple.Tuple9;
+
+public class Tuple9Builder<T0, T1, T2, T3, T4, T5, T6, T7, T8> {
+
+       private List<Tuple9<T0, T1, T2, T3, T4, T5, T6, T7, T8>> tuples = new 
ArrayList<>();
+
+       public Tuple9Builder<T0, T1, T2, T3, T4, T5, T6, T7, T8> add(T0 value0, 
T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6, T7 value7, T8 
value8){
+               tuples.add(new Tuple9<>(value0, value1, value2, value3, value4, 
value5, value6, value7, value8));
+               return this;
+       }
+
+       @SuppressWarnings("unchecked")
+       public Tuple9<T0, T1, T2, T3, T4, T5, T6, T7, T8>[] build(){
+               return tuples.toArray(new Tuple9[tuples.size()]);
+       }
+}

http://git-wip-us.apache.org/repos/asf/flink/blob/7081836e/flink-core/src/test/java/org/apache/flink/api/java/tuple/TupleGenerator.java
----------------------------------------------------------------------
diff --git 
a/flink-core/src/test/java/org/apache/flink/api/java/tuple/TupleGenerator.java 
b/flink-core/src/test/java/org/apache/flink/api/java/tuple/TupleGenerator.java
new file mode 100644
index 0000000..8b149bd
--- /dev/null
+++ 
b/flink-core/src/test/java/org/apache/flink/api/java/tuple/TupleGenerator.java
@@ -0,0 +1,521 @@
+/*
+ * 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 org.apache.flink.api.java.tuple;
+
+import com.google.common.base.Charsets;
+import com.google.common.io.Files;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.Scanner;
+
+/**
+ * Source code generator for tuple classes and classes which depend on the 
arity of tuples.
+ */
+class TupleGenerator {
+
+       // Parameters for tuple classes
+
+       private static final String ROOT_DIRECTORY = 
"./flink-core/src/main/java";
+
+       private static final String PACKAGE = "org.apache.flink.api.java.tuple";
+
+       private static final String BUILDER_SUFFIX = "builder";
+
+       private static final String GEN_TYPE_PREFIX = "T";
+
+       // Parameters for tuple-dependent classes
+       private static final String BEGIN_INDICATOR = 
"BEGIN_OF_TUPLE_DEPENDENT_CODE";
+
+       private static final String END_INDICATOR = 
"END_OF_TUPLE_DEPENDENT_CODE";
+
+       // Parameters for TupleTypeInfo
+       private static final String TUPLE_PACKAGE = 
"org.apache.flink.api.java.tuple";
+
+       private static final String TUPLE_CLASSNAME = "Tuple";
+
+       // min. and max. tuple arity
+       private static final int FIRST = 1;
+
+       private static final int LAST = 25;
+
+       
+       public static void main(String[] args) throws Exception {
+               System.err.println("Current directory 
"+System.getProperty("user.dir"));
+               String rootDir = ROOT_DIRECTORY;
+               if(args.length > 0) {
+                       rootDir = args[0] + "/" + ROOT_DIRECTORY;
+               }
+               System.err.println("Using root directory: "+rootDir);
+               File root = new File(rootDir);
+
+               createTupleClasses(root);
+
+               createTupleBuilderClasses(root);
+
+               modifyTupleType(root);
+
+       }
+
+       private static File getPackage(File root, String packageString) {
+               File dir = new File(root, packageString.replace('.', '/'));
+               if (!dir.exists() && dir.isDirectory()) {
+                       System.err.println("None existent directory: " + 
dir.getAbsolutePath());
+                       System.exit(1);
+               }
+               return dir;
+       }
+
+       private static void insertCodeIntoFile(String code, File file) throws 
IOException {
+               String fileContent = Files.toString(file, Charsets.UTF_8);
+               
+               try (Scanner s = new Scanner(fileContent)) {
+                       StringBuilder sb = new StringBuilder();
+                       String line;
+       
+                       boolean indicatorFound = false;
+       
+                       // add file beginning
+                       while (s.hasNextLine() && (line = s.nextLine()) != 
null) {
+                               sb.append(line).append("\n");
+                               if (line.contains(BEGIN_INDICATOR)) {
+                                       indicatorFound = true;
+                                       break;
+                               }
+                       }
+       
+                       if(!indicatorFound) {
+                               System.out.println("No indicator found in '" + 
file + "'. Will skip code generation.");
+                               s.close();
+                               return;
+                       }
+       
+                       // add generator signature
+                       sb.append("\t// GENERATED FROM 
").append(TupleGenerator.class.getName()).append(".\n");
+       
+                       // add tuple dependent code
+                       sb.append(code).append("\n");
+       
+                       // skip generated code
+                       while (s.hasNextLine() && (line = s.nextLine()) != 
null) {
+                               if (line.contains(END_INDICATOR)) {
+                                       sb.append(line).append("\n");
+                                       break;
+                               }
+                       }
+       
+                       // add file ending
+                       while (s.hasNextLine() && (line = s.nextLine()) != 
null) {
+                               sb.append(line).append("\n");
+                       }
+                       Files.write(sb.toString(), file, Charsets.UTF_8);
+               }
+       }
+
+       
+       private static void modifyTupleType(File root) throws IOException {
+               // generate code
+               StringBuilder sb = new StringBuilder();
+               sb.append("\tprivate static final Class<?>[] CLASSES = new 
Class<?>[] {\n\t\tTuple0.class");
+               for (int i = FIRST; i <= LAST; i++) {
+                       sb.append(", Tuple").append(i).append(".class");
+               }
+               sb.append("\n\t};");
+
+               // insert code into file
+               File dir = getPackage(root, TUPLE_PACKAGE);
+               File tupleTypeInfoClass = new File(dir, TUPLE_CLASSNAME + 
".java");
+               insertCodeIntoFile(sb.toString(), tupleTypeInfoClass);
+       }
+
+       private static void createTupleClasses(File root) throws 
FileNotFoundException {
+               File dir = getPackage(root, PACKAGE);
+
+               for (int i = FIRST; i <= LAST; i++) {
+                       File tupleFile = new File(dir, "Tuple" + i + ".java");
+                               PrintWriter writer = new PrintWriter(tupleFile);
+                       writeTupleClass(writer, i);
+                       writer.flush();
+                       writer.close();
+               }
+       }
+
+       private static void writeTupleClass(PrintWriter w, int numFields) {
+               final String className = "Tuple" + numFields;
+
+               // head
+               w.print(HEADER);
+
+               // package and imports
+               w.println("package " + PACKAGE + ';');
+               w.println();
+               w.println("import org.apache.flink.util.StringUtils;");
+               w.println();
+
+               // class declaration and class comments
+               w.println("/**");
+               w.println(" * A tuple with " + numFields + " fields. Tuples are 
strongly typed; each field may be of a separate type.");
+               w.println(" * The fields of the tuple can be accessed directly 
as public fields (f0, f1, ...) or via their position");
+               w.println(" * through the {@link #getField(int)} method. The 
tuple field positions start at zero.");
+               w.println(" * <p>");
+               w.println(" * Tuples are mutable types, meaning that their 
fields can be re-assigned. This allows functions that work");
+               w.println(" * with Tuples to reuse objects in order to reduce 
pressure on the garbage collector.");
+               w.println(" *");
+               w.println(" * @see Tuple");
+               w.println(" *");
+               for (int i = 0; i < numFields; i++) {
+                       w.println(" * @param <" + GEN_TYPE_PREFIX + i + "> The 
type of field " + i);
+               }
+               w.println(" */");
+               w.print("public class " + className + "<");
+               for (int i = 0; i < numFields; i++) {
+                       if (i > 0) {
+                               w.print(", ");
+                       }
+                       w.print(GEN_TYPE_PREFIX + i);
+               }
+               w.println("> extends Tuple {");
+               w.println();
+
+               w.println("\tprivate static final long serialVersionUID = 1L;");
+               w.println();
+
+               // fields
+               for (int i = 0; i < numFields; i++) {
+                       w.println("\t/** Field " + i + " of the tuple. */");
+                       w.println("\tpublic " + GEN_TYPE_PREFIX + i + " f" + i 
+ ';');
+               }
+               w.println();
+
+               String paramList = "("; // This will be like "(T0 value0, T1 
value1)"
+               for (int i = 0; i < numFields; i++) {
+                       if (i > 0) {
+                               paramList += ", ";
+                       }
+                       paramList += GEN_TYPE_PREFIX + i + " value" + i;
+               }
+               paramList += ")";
+
+               // constructors
+               w.println("\t/**");
+               w.println("\t * Creates a new tuple where all fields are 
null.");
+               w.println("\t */");
+               w.println("\tpublic " + className + "() {}");
+               w.println();
+               w.println("\t/**");
+               w.println("\t * Creates a new tuple and assigns the given 
values to the tuple's fields.");
+               w.println("\t *");
+               for (int i = 0; i < numFields; i++) {
+                       w.println("\t * @param value" + i + " The value for 
field " + i);
+               }
+               w.println("\t */");
+               w.println("\tpublic " + className + paramList + " {");
+               for (int i = 0; i < numFields; i++) {
+                       w.println("\t\tthis.f" + i + " = value" + i + ';');
+               }
+               w.println("\t}");
+               w.println();
+
+
+               // arity accessor
+               w.println("\t@Override");
+               w.println("\tpublic int getArity() { return " + numFields + "; 
}");
+               w.println();
+
+               // accessor getter method
+               w.println("\t@Override");
+               w.println("\t@SuppressWarnings(\"unchecked\")");
+               w.println("\tpublic <T> T getField(int pos) {");
+               w.println("\t\tswitch(pos) {");
+               for (int i = 0; i < numFields; i++) {
+                       w.println("\t\t\tcase " + i + ": return (T) this.f" + i 
+ ';');
+               }
+               w.println("\t\t\tdefault: throw new 
IndexOutOfBoundsException(String.valueOf(pos));");
+               w.println("\t\t}");
+               w.println("\t}");
+               w.println();
+
+               // accessor setter method
+               w.println("\t@Override");
+               w.println("\t@SuppressWarnings(\"unchecked\")");
+               w.println("\tpublic <T> void setField(T value, int pos) {");
+               w.println("\t\tswitch(pos) {");
+               for (int i = 0; i < numFields; i++) {
+                       w.println("\t\t\tcase " + i + ':');
+                       w.println("\t\t\t\tthis.f" + i + " = (" + 
GEN_TYPE_PREFIX + i + ") value;");
+                       w.println("\t\t\t\tbreak;");
+               }
+               w.println("\t\t\tdefault: throw new 
IndexOutOfBoundsException(String.valueOf(pos));");
+               w.println("\t\t}");
+               w.println("\t}");
+               w.println();
+
+               // accessor setter method for all fields
+               w.println("\t/**");
+               w.println("\t * Sets new values to all fields of the tuple.");
+               w.println("\t *");
+               for (int i = 0; i < numFields; i++) {
+                       w.println("\t * @param value" + i + " The value for 
field " + i);
+               }
+               w.println("\t */");
+               w.println("\tpublic void setFields" + paramList + " {");
+               for (int i = 0; i < numFields; i++) {
+                       w.println("\t\tthis.f" + i + " = value" + i + ';');
+               }
+               w.println("\t}");
+               w.println();
+
+               // swap method only for Tuple2
+               if (numFields == 2) {
+                       w.println("\t/**");
+                       w.println("\t* Returns a shallow copy of the tuple with 
swapped values.");
+                       w.println("\t*");
+                       w.println("\t* @return shallow copy of the tuple with 
swapped values");
+                       w.println("\t*/");
+                       w.println("\tpublic Tuple2<T1, T0> swap() {");
+                       w.println("\t\treturn new Tuple2<T1, T0>(f1, f0);");
+                       w.println("\t}");
+               }
+
+               // standard utilities (toString, equals, hashCode, copy)
+               w.println();
+               w.println("\t// 
-------------------------------------------------------------------------------------------------");
+               w.println("\t// standard utilities");
+               w.println("\t// 
-------------------------------------------------------------------------------------------------");
+               w.println();
+               w.println("\t/**");
+               w.println("\t * Creates a string representation of the tuple in 
the form");
+               w.print("\t * (f0");
+               for (int i = 1; i < numFields; i++) {
+                       w.print(", f" + i);
+               }
+               w.println("),");
+               w.println("\t * where the individual fields are the value 
returned by calling {@link Object#toString} on that field.");
+               w.println("\t * @return The string representation of the 
tuple.");
+               w.println("\t */");
+               w.println("\t@Override");
+               w.println("\tpublic String toString() {");
+               w.println("\t\treturn \"(\" + 
StringUtils.arrayAwareToString(this.f0)");
+               for (int i = 1; i < numFields; i++) {
+                       w.println("\t\t\t+ \",\" + 
StringUtils.arrayAwareToString(this.f" + i + ")");
+               }
+               w.println("\t\t\t+ \")\";");
+               w.println("\t}");
+
+               w.println();
+               w.println("\t/**");
+               w.println("\t * Deep equality for tuples by calling equals() on 
the tuple members");
+               w.println("\t * @param o the object checked for equality");
+               w.println("\t * @return true if this is equal to o.");
+               w.println("\t */");
+               w.println("\t@Override");
+               w.println("\tpublic boolean equals(Object o) {");
+               w.println("\t\tif(this == o) { return true; }");
+               w.println("\t\tif (!(o instanceof " + className + ")) { return 
false; }");
+               w.println("\t\t@SuppressWarnings(\"rawtypes\")");
+               w.println("\t\t" + className + " tuple = (" + className + ") 
o;");
+               for (int i = 0; i < numFields; i++) {
+                       String field = "f" + i;
+                       w.println("\t\tif (" + field + " != null ? !" + field 
+".equals(tuple." +
+                                       field + ") : tuple." + field + " != 
null) { return false; }");
+               }
+               w.println("\t\treturn true;");
+               w.println("\t}");
+
+               w.println();
+               w.println("\t@Override");
+               w.println("\tpublic int hashCode() {");
+               w.println("\t\tint result = f0 != null ? f0.hashCode() : 0;");
+               for (int i = 1; i < numFields; i++) {
+                       String field = "f" + i;
+                       w.println("\t\tresult = 31 * result + (" + field + " != 
null ? " + field + ".hashCode() : 0);");
+               }
+               w.println("\t\treturn result;");
+               w.println("\t}");
+
+
+               String tupleTypes = "<";
+               for (int i = 0; i < numFields; i++) {
+                       tupleTypes += "T" + i;
+                       if (i < numFields - 1) {
+                               tupleTypes += ",";
+                       }
+               }
+               tupleTypes += ">";
+
+               w.println();
+               w.println("\t/**");
+               w.println("\t* Shallow tuple copy.");
+               w.println("\t* @return A new Tuple with the same fields as 
this.");
+               w.println("\t*/");
+               w.println("\t@Override");
+               w.println("\t@SuppressWarnings(\"unchecked\")");
+               w.println("\tpublic " + className + tupleTypes + " copy(){ ");
+
+               w.print("\t\treturn new " + className + tupleTypes + 
"(this.f0");
+               if (numFields > 1) {
+                       w.println(",");
+               }
+               for (int i = 1; i < numFields; i++) {
+                       String field = "f" + i;
+                       w.print("\t\t\tthis." + field);
+                       if (i < numFields - 1) {
+                               w.println(",");
+                       }
+               }
+               w.println(");");
+               w.println("\t}");
+
+               w.println();
+               w.println("\t/**");
+               w.println("\t * Creates a new tuple and assigns the given 
values to the tuple's fields.");
+               w.println("\t * This is more convenient than using the 
constructor, because the compiler can");
+               w.println("\t * infer the generic type arguments implicitly. 
For example:");
+               w.println("\t * {@code Tuple3.of(n, x, s)}");
+               w.println("\t * instead of");
+               w.println("\t * {@code new Tuple3<Integer, Double, String>(n, 
x, s)}");
+               w.println("\t */");
+               w.println("\tpublic static " + tupleTypes + " " + className + 
tupleTypes + " of" + paramList + " {");
+               w.print("\t\treturn new " + className + tupleTypes + "(");
+               for(int i = 0; i < numFields; i++) {
+                       w.print("value" + i);
+                       if(i < numFields - 1) {
+                               w.print(", ");
+                       }
+               }
+               w.println(");");
+               w.println("\t}");
+
+               // foot
+               w.println("}");
+       }
+
+       private static void createTupleBuilderClasses(File root) throws 
FileNotFoundException {
+               File dir = getPackage(root, PACKAGE+"."+BUILDER_SUFFIX);
+
+               for (int i = FIRST; i <= LAST; i++) {
+                       File tupleFile = new File(dir, "Tuple" + i + 
"Builder.java");
+                       PrintWriter writer = new PrintWriter(tupleFile);
+                       writeTupleBuilderClass(writer, i);
+                       writer.flush();
+                       writer.close();
+               }
+       }
+
+       private static void printGenericsString(PrintWriter w, int numFields){
+               w.print("<");
+               for (int i = 0; i < numFields; i++) {
+                       if (i > 0) {
+                               w.print(", ");
+                       }
+                       w.print(GEN_TYPE_PREFIX + i);
+               }
+               w.print(">");
+       }
+
+       private static void writeTupleBuilderClass(PrintWriter w, int 
numFields) {
+               final String className = "Tuple" + numFields + "Builder";
+
+               // head
+               w.print(HEADER);
+
+               // package and imports
+               w.println("package " + PACKAGE + "." + BUILDER_SUFFIX + ';');
+               w.println();
+               w.println("import java.util.ArrayList;");
+               w.println("import java.util.List;");
+               w.println();
+               w.println("import " + PACKAGE + ".Tuple" + numFields + ";");
+               w.println();
+
+               // class declaration
+               w.print("public class " + className);
+               printGenericsString(w, numFields);
+               w.println(" {");
+               w.println();
+
+               // Class-Attributes - a list of tuples
+               w.print("\tprivate List<Tuple" + numFields);
+               printGenericsString(w, numFields);
+               w.println("> tuples = new ArrayList<>();");
+               w.println();
+
+               // add(...) function for adding a single tuple
+               w.print("\tpublic " + className);
+               printGenericsString(w, numFields);
+               w.print(" add(");
+               for (int i = 0; i < numFields; i++) {
+                       if (i > 0) {
+                               w.print(", ");
+                       }
+                       w.print(GEN_TYPE_PREFIX + i + " value" + i);
+               }
+               w.println("){");
+               w.print("\t\ttuples.add(new Tuple" + numFields + "<>(");
+               for (int i = 0; i < numFields; i++) {
+                       if (i > 0) {
+                               w.print(", ");
+                       }
+                       w.print("value" + i);
+               }
+               w.println("));");
+               w.println("\t\treturn this;");
+               w.println("\t}");
+               w.println();
+
+               // build() function, returns an array of tuples
+               w.println("\t@SuppressWarnings(\"unchecked\")");
+               w.print("\tpublic Tuple" + numFields);
+               printGenericsString(w, numFields);
+               w.println("[] build(){");
+               w.println("\t\treturn tuples.toArray(new Tuple" + numFields + 
"[tuples.size()]);");
+               w.println("\t}");
+
+               // foot
+               w.println("}");
+       }
+
+       private static String HEADER =
+               "/*\n"
+               + " * Licensed to the Apache Software Foundation (ASF) under 
one\n"
+               + " * or more contributor license agreements.  See the NOTICE 
file\n"
+               + " * distributed with this work for additional information\n"
+               + " * regarding copyright ownership.  The ASF licenses this 
file\n"
+               + " * to you under the Apache License, Version 2.0 (the\n"
+               + " * \"License\"); you may not use this file except in 
compliance\n"
+               + " * with the License.  You may obtain a copy of the License 
at\n"
+               + " *\n"
+               + " *     http://www.apache.org/licenses/LICENSE-2.0\n";
+               + " *\n"
+               + " * Unless required by applicable law or agreed to in 
writing, software\n"
+               + " * distributed under the License is distributed on an \"AS 
IS\" BASIS,\n"
+               + " * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 
express or implied.\n"
+               + " * See the License for the specific language governing 
permissions and\n"
+               + " * limitations under the License.\n"
+               + " */" +
+               "\n" +
+               "\n" +
+               "\n" +
+               "// 
--------------------------------------------------------------\n" +
+               "//  THIS IS A GENERATED SOURCE FILE. DO NOT EDIT!\n" +
+               "//  GENERATED FROM " + TupleGenerator.class.getName() + ".\n" +
+               "// 
--------------------------------------------------------------\n\n\n";
+}

http://git-wip-us.apache.org/repos/asf/flink/blob/7081836e/flink-java/src/main/java/org/apache/flink/api/java/tuple/Tuple.java
----------------------------------------------------------------------
diff --git 
a/flink-java/src/main/java/org/apache/flink/api/java/tuple/Tuple.java 
b/flink-java/src/main/java/org/apache/flink/api/java/tuple/Tuple.java
deleted file mode 100644
index 71b1f61..0000000
--- a/flink-java/src/main/java/org/apache/flink/api/java/tuple/Tuple.java
+++ /dev/null
@@ -1,118 +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 org.apache.flink.api.java.tuple;
-
-import org.apache.flink.types.NullFieldException;
-
-
-/**
- * The base class of all tuples. Tuples have a fix length and contain a set of 
fields,
- * which may all be of different types. Because Tuples are strongly typed, 
each distinct
- * tuple length is represented by its own class. Tuples exists with up to 25 
fields and
- * are described in the classes {@link Tuple1} to {@link Tuple25}.
- * <p>
- * The fields in the tuples may be accessed directly a public fields, or via 
position (zero indexed)
- * {@link #getField(int)}.
- * <p>
- * Tuples are in principle serializable. However, they may contain 
non-serializable fields,
- * in which case serialization will fail.
- */
-public abstract class Tuple implements java.io.Serializable {
-       
-       private static final long serialVersionUID = 1L;
-       
-       public static final int MAX_ARITY = 25;
-       
-       
-       /**
-        * Gets the field at the specified position.
-        *
-        * @param pos The position of the field, zero indexed.
-        * @return The field at the specified position.
-        * @throws IndexOutOfBoundsException Thrown, if the position is 
negative, or equal to, or larger than the number of fields.
-        */
-       public abstract <T> T getField(int pos);
-       
-       /**
-        * Gets the field at the specified position, throws NullFieldException 
if the field is null. Used for comparing key fields.
-        * 
-        * @param pos The position of the field, zero indexed. 
-        * @return The field at the specified position.
-        * @throws IndexOutOfBoundsException Thrown, if the position is 
negative, or equal to, or larger than the number of fields.
-        * @throws NullFieldException Thrown, if the field at pos is null.
-        */
-       public <T> T getFieldNotNull(int pos){
-               T field = getField(pos);
-               if (field != null) {
-                       return field;
-               } else {
-                       throw new NullFieldException(pos);
-               }
-       }
-
-       /**
-        * Sets the field at the specified position.
-        *
-        * @param value The value to be assigned to the field at the specified 
position.
-        * @param pos The position of the field, zero indexed.
-        * @throws IndexOutOfBoundsException Thrown, if the position is 
negative, or equal to, or larger than the number of fields.
-        */
-       public abstract <T> void setField(T value, int pos);
-
-       /**
-        * Gets the number of field in the tuple (the tuple arity).
-        *
-        * @return The number of fields in the tuple.
-        */
-       public abstract int getArity();
-
-       /**
-        * Shallow tuple copy.
-        * @return A new Tuple with the same fields as this.
-        */
-       public abstract <T extends Tuple> T copy();
-
-       // 
--------------------------------------------------------------------------------------------
-       
-       /**
-        * Gets the class corresponding to the tuple of the given arity 
(dimensions). For
-        * example, {@code getTupleClass(3)} will return the {@code 
Tuple3.class}.
-        * 
-        * @param arity The arity of the tuple class to get.
-        * @return The tuple class with the given arity.
-        */
-       @SuppressWarnings("unchecked")
-       public static Class<? extends Tuple> getTupleClass(int arity) {
-               if (arity < 0 || arity > MAX_ARITY) {
-                       throw new IllegalArgumentException("The tuple arity 
must be in [0, " + MAX_ARITY + "].");
-               }
-               return (Class<? extends Tuple>) CLASSES[arity];
-       }
-       
-       // 
--------------------------------------------------------------------------------------------
 
-       // The following lines are generated.
-       // 
--------------------------------------------------------------------------------------------
-       
-       // BEGIN_OF_TUPLE_DEPENDENT_CODE        
-       // GENERATED FROM org.apache.flink.api.java.tuple.TupleGenerator.
-       private static final Class<?>[] CLASSES = new Class<?>[] {
-               Tuple0.class, Tuple1.class, Tuple2.class, Tuple3.class, 
Tuple4.class, Tuple5.class, Tuple6.class, Tuple7.class, Tuple8.class, 
Tuple9.class, Tuple10.class, Tuple11.class, Tuple12.class, Tuple13.class, 
Tuple14.class, Tuple15.class, Tuple16.class, Tuple17.class, Tuple18.class, 
Tuple19.class, Tuple20.class, Tuple21.class, Tuple22.class, Tuple23.class, 
Tuple24.class, Tuple25.class
-       };
-       // END_OF_TUPLE_DEPENDENT_CODE
-}

http://git-wip-us.apache.org/repos/asf/flink/blob/7081836e/flink-java/src/main/java/org/apache/flink/api/java/tuple/Tuple0.java
----------------------------------------------------------------------
diff --git 
a/flink-java/src/main/java/org/apache/flink/api/java/tuple/Tuple0.java 
b/flink-java/src/main/java/org/apache/flink/api/java/tuple/Tuple0.java
deleted file mode 100644
index c3386dc..0000000
--- a/flink-java/src/main/java/org/apache/flink/api/java/tuple/Tuple0.java
+++ /dev/null
@@ -1,98 +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 org.apache.flink.api.java.tuple;
-
-import java.io.ObjectStreamException;
-
-/**
- * A tuple with 0 fields.
- * 
- * <p>The Tuple0 is a soft singleton, i.e., there is a "singleton" instance, 
but it does
- * not prevent creation of additional instances.</p>
- * 
- * @see Tuple
- */
-public class Tuple0 extends Tuple {
-       private static final long serialVersionUID = 1L;
-
-       /** An immutable reusable Tuple0 instance */
-       public static final Tuple0 INSTANCE = new Tuple0();
-
-       // 
------------------------------------------------------------------------
-       
-       @Override
-       public int getArity() {
-               return 0;
-       }
-
-       @Override
-       public <T> T getField(int pos) {
-               throw new IndexOutOfBoundsException(String.valueOf(pos));
-       }
-
-       @Override
-       public <T> void setField(T value, int pos) {
-               throw new IndexOutOfBoundsException(String.valueOf(pos));
-       }
-
-       /**
-        * Shallow tuple copy.
-        * @return A new Tuple with the same fields as this.
-        */
-       @Override
-       @SuppressWarnings("unchecked")
-       public Tuple0 copy(){
-               return new Tuple0();
-       }
-
-       // 
-------------------------------------------------------------------------------------------------
-       // standard utilities
-       // 
-------------------------------------------------------------------------------------------------
-
-       /**
-        * Creates a string representation of the tuple in the form "()"
-        * 
-        * @return The string representation of the tuple.
-        */
-       @Override
-       public String toString() {
-               return "()";
-       }
-
-       /**
-        * Deep equality for tuples by calling equals() on the tuple members
-        * 
-        * @param o
-        *            the object checked for equality
-        * @return true if this is equal to o.
-        */
-       @Override
-       public boolean equals(Object o) {
-               return this == o || o instanceof Tuple0;
-       }
-
-       @Override
-       public int hashCode() {
-               return 0;
-       }
-
-       // singleton deserialization
-       private Object readResolve() throws ObjectStreamException {
-               return INSTANCE;
-       }
-}

http://git-wip-us.apache.org/repos/asf/flink/blob/7081836e/flink-java/src/main/java/org/apache/flink/api/java/tuple/Tuple1.java
----------------------------------------------------------------------
diff --git 
a/flink-java/src/main/java/org/apache/flink/api/java/tuple/Tuple1.java 
b/flink-java/src/main/java/org/apache/flink/api/java/tuple/Tuple1.java
deleted file mode 100644
index 01c5501..0000000
--- a/flink-java/src/main/java/org/apache/flink/api/java/tuple/Tuple1.java
+++ /dev/null
@@ -1,154 +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.
- */
-
-
-// --------------------------------------------------------------
-//  THIS IS A GENERATED SOURCE FILE. DO NOT EDIT!
-//  GENERATED FROM org.apache.flink.api.java.tuple.TupleGenerator.
-// --------------------------------------------------------------
-
-
-package org.apache.flink.api.java.tuple;
-
-import org.apache.flink.util.StringUtils;
-
-/**
- * A tuple with 1 fields. Tuples are strongly typed; each field may be of a 
separate type.
- * The fields of the tuple can be accessed directly as public fields (f0, f1, 
...) or via their position
- * through the {@link #getField(int)} method. The tuple field positions start 
at zero.
- * <p>
- * Tuples are mutable types, meaning that their fields can be re-assigned. 
This allows functions that work
- * with Tuples to reuse objects in order to reduce pressure on the garbage 
collector.
- *
- * @see Tuple
- *
- * @param <T0> The type of field 0
- */
-public class Tuple1<T0> extends Tuple {
-
-       private static final long serialVersionUID = 1L;
-
-       /** Field 0 of the tuple. */
-       public T0 f0;
-
-       /**
-        * Creates a new tuple where all fields are null.
-        */
-       public Tuple1() {}
-
-       /**
-        * Creates a new tuple and assigns the given values to the tuple's 
fields.
-        *
-        * @param value0 The value for field 0
-        */
-       public Tuple1(T0 value0) {
-               this.f0 = value0;
-       }
-
-       @Override
-       public int getArity() { return 1; }
-
-       @Override
-       @SuppressWarnings("unchecked")
-       public <T> T getField(int pos) {
-               switch(pos) {
-                       case 0: return (T) this.f0;
-                       default: throw new 
IndexOutOfBoundsException(String.valueOf(pos));
-               }
-       }
-
-       @Override
-       @SuppressWarnings("unchecked")
-       public <T> void setField(T value, int pos) {
-               switch(pos) {
-                       case 0:
-                               this.f0 = (T0) value;
-                               break;
-                       default: throw new 
IndexOutOfBoundsException(String.valueOf(pos));
-               }
-       }
-
-       /**
-        * Sets new values to all fields of the tuple.
-        *
-        * @param value0 The value for field 0
-        */
-       public void setFields(T0 value0) {
-               this.f0 = value0;
-       }
-
-
-       // 
-------------------------------------------------------------------------------------------------
-       // standard utilities
-       // 
-------------------------------------------------------------------------------------------------
-
-       /**
-        * Creates a string representation of the tuple in the form
-        * (f0),
-        * where the individual fields are the value returned by calling {@link 
Object#toString} on that field.
-        * @return The string representation of the tuple.
-        */
-       @Override
-       public String toString() {
-               return "(" + StringUtils.arrayAwareToString(this.f0)
-                       + ")";
-       }
-
-       /**
-        * Deep equality for tuples by calling equals() on the tuple members
-        * @param o the object checked for equality
-        * @return true if this is equal to o.
-        */
-       @Override
-       public boolean equals(Object o) {
-               if(this == o) { return true; }
-               if (!(o instanceof Tuple1)) { return false; }
-               @SuppressWarnings("rawtypes")
-               Tuple1 tuple = (Tuple1) o;
-               if (f0 != null ? !f0.equals(tuple.f0) : tuple.f0 != null) { 
return false; }
-               return true;
-       }
-
-       @Override
-       public int hashCode() {
-               int result = f0 != null ? f0.hashCode() : 0;
-               return result;
-       }
-
-       /**
-       * Shallow tuple copy.
-       * @return A new Tuple with the same fields as this.
-       */
-       @Override
-       @SuppressWarnings("unchecked")
-       public Tuple1<T0> copy(){ 
-               return new Tuple1<T0>(this.f0);
-       }
-
-       /**
-        * Creates a new tuple and assigns the given values to the tuple's 
fields.
-        * This is more convenient than using the constructor, because the 
compiler can
-        * infer the generic type arguments implicitly. For example:
-        * {@code Tuple3.of(n, x, s)}
-        * instead of
-        * {@code new Tuple3<Integer, Double, String>(n, x, s)}
-        */
-       public static <T0> Tuple1<T0> of(T0 value0) {
-               return new Tuple1<T0>(value0);
-       }
-}

Reply via email to