| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,366 @@ | ||
| /** | ||
| * Copyright (c) 2014-2015, Data Geekery GmbH, contact@datageekery.com | ||
| * | ||
| * Licensed 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.jooq.lambda.tuple; | ||
|
|
||
| import java.io.Serializable; | ||
| import java.util.Arrays; | ||
| import java.util.Iterator; | ||
| import java.util.List; | ||
| import java.util.Objects; | ||
|
|
||
| import org.jooq.lambda.function.Function1; | ||
| import org.jooq.lambda.function.Function12; | ||
|
|
||
| /** | ||
| * A tuple of degree 12. | ||
| * | ||
| * @author Lukas Eder | ||
| */ | ||
| public class Tuple12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> implements Tuple, Comparable<Tuple12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>>, Serializable, Cloneable { | ||
|
|
||
| private static final long serialVersionUID = 1L; | ||
|
|
||
| public final T1 v1; | ||
| public final T2 v2; | ||
| public final T3 v3; | ||
| public final T4 v4; | ||
| public final T5 v5; | ||
| public final T6 v6; | ||
| public final T7 v7; | ||
| public final T8 v8; | ||
| public final T9 v9; | ||
| public final T10 v10; | ||
| public final T11 v11; | ||
| public final T12 v12; | ||
|
|
||
| public T1 v1() { | ||
| return v1; | ||
| } | ||
|
|
||
| public T2 v2() { | ||
| return v2; | ||
| } | ||
|
|
||
| public T3 v3() { | ||
| return v3; | ||
| } | ||
|
|
||
| public T4 v4() { | ||
| return v4; | ||
| } | ||
|
|
||
| public T5 v5() { | ||
| return v5; | ||
| } | ||
|
|
||
| public T6 v6() { | ||
| return v6; | ||
| } | ||
|
|
||
| public T7 v7() { | ||
| return v7; | ||
| } | ||
|
|
||
| public T8 v8() { | ||
| return v8; | ||
| } | ||
|
|
||
| public T9 v9() { | ||
| return v9; | ||
| } | ||
|
|
||
| public T10 v10() { | ||
| return v10; | ||
| } | ||
|
|
||
| public T11 v11() { | ||
| return v11; | ||
| } | ||
|
|
||
| public T12 v12() { | ||
| return v12; | ||
| } | ||
|
|
||
| public Tuple12(Tuple12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> tuple) { | ||
| this.v1 = tuple.v1; | ||
| this.v2 = tuple.v2; | ||
| this.v3 = tuple.v3; | ||
| this.v4 = tuple.v4; | ||
| this.v5 = tuple.v5; | ||
| this.v6 = tuple.v6; | ||
| this.v7 = tuple.v7; | ||
| this.v8 = tuple.v8; | ||
| this.v9 = tuple.v9; | ||
| this.v10 = tuple.v10; | ||
| this.v11 = tuple.v11; | ||
| this.v12 = tuple.v12; | ||
| } | ||
|
|
||
| public Tuple12(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12) { | ||
| this.v1 = v1; | ||
| this.v2 = v2; | ||
| this.v3 = v3; | ||
| this.v4 = v4; | ||
| this.v5 = v5; | ||
| this.v6 = v6; | ||
| this.v7 = v7; | ||
| this.v8 = v8; | ||
| this.v9 = v9; | ||
| this.v10 = v10; | ||
| this.v11 = v11; | ||
| this.v12 = v12; | ||
| } | ||
|
|
||
| /** | ||
| * Concatenate a value to this tuple. | ||
| */ | ||
| public final <T13> Tuple13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> concat(T13 value) { | ||
| return new Tuple13<>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, value); | ||
| } | ||
|
|
||
| /** | ||
| * Concatenate a tuple to this tuple. | ||
| */ | ||
| public final <T13> Tuple13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> concat(Tuple1<T13> tuple) { | ||
| return new Tuple13<>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, tuple.v1); | ||
| } | ||
|
|
||
| /** | ||
| * Concatenate a tuple to this tuple. | ||
| */ | ||
| public final <T13, T14> Tuple14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> concat(Tuple2<T13, T14> tuple) { | ||
| return new Tuple14<>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, tuple.v1, tuple.v2); | ||
| } | ||
|
|
||
| /** | ||
| * Concatenate a tuple to this tuple. | ||
| */ | ||
| public final <T13, T14, T15> Tuple15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> concat(Tuple3<T13, T14, T15> tuple) { | ||
| return new Tuple15<>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, tuple.v1, tuple.v2, tuple.v3); | ||
| } | ||
|
|
||
| /** | ||
| * Concatenate a tuple to this tuple. | ||
| */ | ||
| public final <T13, T14, T15, T16> Tuple16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> concat(Tuple4<T13, T14, T15, T16> tuple) { | ||
| return new Tuple16<>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, tuple.v1, tuple.v2, tuple.v3, tuple.v4); | ||
| } | ||
|
|
||
| /** | ||
| * Apply this tuple as arguments to a function. | ||
| */ | ||
| public final <R> R map(Function12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, R> function) { | ||
| return function.apply(this); | ||
| } | ||
|
|
||
| /** | ||
| * Apply attribute 1 as argument to a function and return a new tuple with the substituted argument. | ||
| */ | ||
| public final <U1> Tuple12<U1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> map1(Function1<? super T1, ? extends U1> function) { | ||
| return Tuple.tuple(function.apply(v1), v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12); | ||
| } | ||
|
|
||
| /** | ||
| * Apply attribute 2 as argument to a function and return a new tuple with the substituted argument. | ||
| */ | ||
| public final <U2> Tuple12<T1, U2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> map2(Function1<? super T2, ? extends U2> function) { | ||
| return Tuple.tuple(v1, function.apply(v2), v3, v4, v5, v6, v7, v8, v9, v10, v11, v12); | ||
| } | ||
|
|
||
| /** | ||
| * Apply attribute 3 as argument to a function and return a new tuple with the substituted argument. | ||
| */ | ||
| public final <U3> Tuple12<T1, T2, U3, T4, T5, T6, T7, T8, T9, T10, T11, T12> map3(Function1<? super T3, ? extends U3> function) { | ||
| return Tuple.tuple(v1, v2, function.apply(v3), v4, v5, v6, v7, v8, v9, v10, v11, v12); | ||
| } | ||
|
|
||
| /** | ||
| * Apply attribute 4 as argument to a function and return a new tuple with the substituted argument. | ||
| */ | ||
| public final <U4> Tuple12<T1, T2, T3, U4, T5, T6, T7, T8, T9, T10, T11, T12> map4(Function1<? super T4, ? extends U4> function) { | ||
| return Tuple.tuple(v1, v2, v3, function.apply(v4), v5, v6, v7, v8, v9, v10, v11, v12); | ||
| } | ||
|
|
||
| /** | ||
| * Apply attribute 5 as argument to a function and return a new tuple with the substituted argument. | ||
| */ | ||
| public final <U5> Tuple12<T1, T2, T3, T4, U5, T6, T7, T8, T9, T10, T11, T12> map5(Function1<? super T5, ? extends U5> function) { | ||
| return Tuple.tuple(v1, v2, v3, v4, function.apply(v5), v6, v7, v8, v9, v10, v11, v12); | ||
| } | ||
|
|
||
| /** | ||
| * Apply attribute 6 as argument to a function and return a new tuple with the substituted argument. | ||
| */ | ||
| public final <U6> Tuple12<T1, T2, T3, T4, T5, U6, T7, T8, T9, T10, T11, T12> map6(Function1<? super T6, ? extends U6> function) { | ||
| return Tuple.tuple(v1, v2, v3, v4, v5, function.apply(v6), v7, v8, v9, v10, v11, v12); | ||
| } | ||
|
|
||
| /** | ||
| * Apply attribute 7 as argument to a function and return a new tuple with the substituted argument. | ||
| */ | ||
| public final <U7> Tuple12<T1, T2, T3, T4, T5, T6, U7, T8, T9, T10, T11, T12> map7(Function1<? super T7, ? extends U7> function) { | ||
| return Tuple.tuple(v1, v2, v3, v4, v5, v6, function.apply(v7), v8, v9, v10, v11, v12); | ||
| } | ||
|
|
||
| /** | ||
| * Apply attribute 8 as argument to a function and return a new tuple with the substituted argument. | ||
| */ | ||
| public final <U8> Tuple12<T1, T2, T3, T4, T5, T6, T7, U8, T9, T10, T11, T12> map8(Function1<? super T8, ? extends U8> function) { | ||
| return Tuple.tuple(v1, v2, v3, v4, v5, v6, v7, function.apply(v8), v9, v10, v11, v12); | ||
| } | ||
|
|
||
| /** | ||
| * Apply attribute 9 as argument to a function and return a new tuple with the substituted argument. | ||
| */ | ||
| public final <U9> Tuple12<T1, T2, T3, T4, T5, T6, T7, T8, U9, T10, T11, T12> map9(Function1<? super T9, ? extends U9> function) { | ||
| return Tuple.tuple(v1, v2, v3, v4, v5, v6, v7, v8, function.apply(v9), v10, v11, v12); | ||
| } | ||
|
|
||
| /** | ||
| * Apply attribute 10 as argument to a function and return a new tuple with the substituted argument. | ||
| */ | ||
| public final <U10> Tuple12<T1, T2, T3, T4, T5, T6, T7, T8, T9, U10, T11, T12> map10(Function1<? super T10, ? extends U10> function) { | ||
| return Tuple.tuple(v1, v2, v3, v4, v5, v6, v7, v8, v9, function.apply(v10), v11, v12); | ||
| } | ||
|
|
||
| /** | ||
| * Apply attribute 11 as argument to a function and return a new tuple with the substituted argument. | ||
| */ | ||
| public final <U11> Tuple12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, U11, T12> map11(Function1<? super T11, ? extends U11> function) { | ||
| return Tuple.tuple(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, function.apply(v11), v12); | ||
| } | ||
|
|
||
| /** | ||
| * Apply attribute 12 as argument to a function and return a new tuple with the substituted argument. | ||
| */ | ||
| public final <U12> Tuple12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, U12> map12(Function1<? super T12, ? extends U12> function) { | ||
| return Tuple.tuple(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, function.apply(v12)); | ||
| } | ||
|
|
||
| @Override | ||
| public final Object[] array() { | ||
| return new Object[] { v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12 }; | ||
| } | ||
|
|
||
| @Override | ||
| public final List<?> list() { | ||
| return Arrays.asList(array()); | ||
| } | ||
|
|
||
| /** | ||
| * The degree of this tuple: 12. | ||
| */ | ||
| @Override | ||
| public final int degree() { | ||
| return 12; | ||
| } | ||
|
|
||
| @Override | ||
| @SuppressWarnings("unchecked") | ||
| public final Iterator<Object> iterator() { | ||
| return (Iterator<Object>) list().iterator(); | ||
| } | ||
|
|
||
| @Override | ||
| public int compareTo(Tuple12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> other) { | ||
| int result = 0; | ||
|
|
||
| result = Tuples.compare(v1, other.v1); if (result != 0) return result; | ||
| result = Tuples.compare(v2, other.v2); if (result != 0) return result; | ||
| result = Tuples.compare(v3, other.v3); if (result != 0) return result; | ||
| result = Tuples.compare(v4, other.v4); if (result != 0) return result; | ||
| result = Tuples.compare(v5, other.v5); if (result != 0) return result; | ||
| result = Tuples.compare(v6, other.v6); if (result != 0) return result; | ||
| result = Tuples.compare(v7, other.v7); if (result != 0) return result; | ||
| result = Tuples.compare(v8, other.v8); if (result != 0) return result; | ||
| result = Tuples.compare(v9, other.v9); if (result != 0) return result; | ||
| result = Tuples.compare(v10, other.v10); if (result != 0) return result; | ||
| result = Tuples.compare(v11, other.v11); if (result != 0) return result; | ||
| result = Tuples.compare(v12, other.v12); if (result != 0) return result; | ||
|
|
||
| return result; | ||
| } | ||
|
|
||
| @Override | ||
| public boolean equals(Object o) { | ||
| if (this == o) | ||
| return true; | ||
| if (!(o instanceof Tuple12)) | ||
| return false; | ||
|
|
||
| @SuppressWarnings({ "unchecked", "rawtypes" }) | ||
| final Tuple12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> that = (Tuple12) o; | ||
|
|
||
| if (!Objects.equals(v1, that.v1)) return false; | ||
| if (!Objects.equals(v2, that.v2)) return false; | ||
| if (!Objects.equals(v3, that.v3)) return false; | ||
| if (!Objects.equals(v4, that.v4)) return false; | ||
| if (!Objects.equals(v5, that.v5)) return false; | ||
| if (!Objects.equals(v6, that.v6)) return false; | ||
| if (!Objects.equals(v7, that.v7)) return false; | ||
| if (!Objects.equals(v8, that.v8)) return false; | ||
| if (!Objects.equals(v9, that.v9)) return false; | ||
| if (!Objects.equals(v10, that.v10)) return false; | ||
| if (!Objects.equals(v11, that.v11)) return false; | ||
| if (!Objects.equals(v12, that.v12)) return false; | ||
|
|
||
| return true; | ||
| } | ||
|
|
||
| @Override | ||
| public int hashCode() { | ||
| final int prime = 31; | ||
| int result = 1; | ||
|
|
||
| result = prime * result + ((v1 == null) ? 0 : v1.hashCode()); | ||
| result = prime * result + ((v2 == null) ? 0 : v2.hashCode()); | ||
| result = prime * result + ((v3 == null) ? 0 : v3.hashCode()); | ||
| result = prime * result + ((v4 == null) ? 0 : v4.hashCode()); | ||
| result = prime * result + ((v5 == null) ? 0 : v5.hashCode()); | ||
| result = prime * result + ((v6 == null) ? 0 : v6.hashCode()); | ||
| result = prime * result + ((v7 == null) ? 0 : v7.hashCode()); | ||
| result = prime * result + ((v8 == null) ? 0 : v8.hashCode()); | ||
| result = prime * result + ((v9 == null) ? 0 : v9.hashCode()); | ||
| result = prime * result + ((v10 == null) ? 0 : v10.hashCode()); | ||
| result = prime * result + ((v11 == null) ? 0 : v11.hashCode()); | ||
| result = prime * result + ((v12 == null) ? 0 : v12.hashCode()); | ||
|
|
||
| return result; | ||
| } | ||
|
|
||
| @Override | ||
| public String toString() { | ||
| return "(" | ||
| + v1 | ||
| + ", " + v2 | ||
| + ", " + v3 | ||
| + ", " + v4 | ||
| + ", " + v5 | ||
| + ", " + v6 | ||
| + ", " + v7 | ||
| + ", " + v8 | ||
| + ", " + v9 | ||
| + ", " + v10 | ||
| + ", " + v11 | ||
| + ", " + v12 | ||
| + ")"; | ||
| } | ||
|
|
||
| @Override | ||
| public Tuple12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> clone() { | ||
| return new Tuple12<>(this); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,377 @@ | ||
| /** | ||
| * Copyright (c) 2014-2015, Data Geekery GmbH, contact@datageekery.com | ||
| * | ||
| * Licensed 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.jooq.lambda.tuple; | ||
|
|
||
| import java.io.Serializable; | ||
| import java.util.Arrays; | ||
| import java.util.Iterator; | ||
| import java.util.List; | ||
| import java.util.Objects; | ||
|
|
||
| import org.jooq.lambda.function.Function1; | ||
| import org.jooq.lambda.function.Function13; | ||
|
|
||
| /** | ||
| * A tuple of degree 13. | ||
| * | ||
| * @author Lukas Eder | ||
| */ | ||
| public class Tuple13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> implements Tuple, Comparable<Tuple13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>>, Serializable, Cloneable { | ||
|
|
||
| private static final long serialVersionUID = 1L; | ||
|
|
||
| public final T1 v1; | ||
| public final T2 v2; | ||
| public final T3 v3; | ||
| public final T4 v4; | ||
| public final T5 v5; | ||
| public final T6 v6; | ||
| public final T7 v7; | ||
| public final T8 v8; | ||
| public final T9 v9; | ||
| public final T10 v10; | ||
| public final T11 v11; | ||
| public final T12 v12; | ||
| public final T13 v13; | ||
|
|
||
| public T1 v1() { | ||
| return v1; | ||
| } | ||
|
|
||
| public T2 v2() { | ||
| return v2; | ||
| } | ||
|
|
||
| public T3 v3() { | ||
| return v3; | ||
| } | ||
|
|
||
| public T4 v4() { | ||
| return v4; | ||
| } | ||
|
|
||
| public T5 v5() { | ||
| return v5; | ||
| } | ||
|
|
||
| public T6 v6() { | ||
| return v6; | ||
| } | ||
|
|
||
| public T7 v7() { | ||
| return v7; | ||
| } | ||
|
|
||
| public T8 v8() { | ||
| return v8; | ||
| } | ||
|
|
||
| public T9 v9() { | ||
| return v9; | ||
| } | ||
|
|
||
| public T10 v10() { | ||
| return v10; | ||
| } | ||
|
|
||
| public T11 v11() { | ||
| return v11; | ||
| } | ||
|
|
||
| public T12 v12() { | ||
| return v12; | ||
| } | ||
|
|
||
| public T13 v13() { | ||
| return v13; | ||
| } | ||
|
|
||
| public Tuple13(Tuple13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> tuple) { | ||
| this.v1 = tuple.v1; | ||
| this.v2 = tuple.v2; | ||
| this.v3 = tuple.v3; | ||
| this.v4 = tuple.v4; | ||
| this.v5 = tuple.v5; | ||
| this.v6 = tuple.v6; | ||
| this.v7 = tuple.v7; | ||
| this.v8 = tuple.v8; | ||
| this.v9 = tuple.v9; | ||
| this.v10 = tuple.v10; | ||
| this.v11 = tuple.v11; | ||
| this.v12 = tuple.v12; | ||
| this.v13 = tuple.v13; | ||
| } | ||
|
|
||
| public Tuple13(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13) { | ||
| this.v1 = v1; | ||
| this.v2 = v2; | ||
| this.v3 = v3; | ||
| this.v4 = v4; | ||
| this.v5 = v5; | ||
| this.v6 = v6; | ||
| this.v7 = v7; | ||
| this.v8 = v8; | ||
| this.v9 = v9; | ||
| this.v10 = v10; | ||
| this.v11 = v11; | ||
| this.v12 = v12; | ||
| this.v13 = v13; | ||
| } | ||
|
|
||
| /** | ||
| * Concatenate a value to this tuple. | ||
| */ | ||
| public final <T14> Tuple14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> concat(T14 value) { | ||
| return new Tuple14<>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, value); | ||
| } | ||
|
|
||
| /** | ||
| * Concatenate a tuple to this tuple. | ||
| */ | ||
| public final <T14> Tuple14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> concat(Tuple1<T14> tuple) { | ||
| return new Tuple14<>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, tuple.v1); | ||
| } | ||
|
|
||
| /** | ||
| * Concatenate a tuple to this tuple. | ||
| */ | ||
| public final <T14, T15> Tuple15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> concat(Tuple2<T14, T15> tuple) { | ||
| return new Tuple15<>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, tuple.v1, tuple.v2); | ||
| } | ||
|
|
||
| /** | ||
| * Concatenate a tuple to this tuple. | ||
| */ | ||
| public final <T14, T15, T16> Tuple16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> concat(Tuple3<T14, T15, T16> tuple) { | ||
| return new Tuple16<>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, tuple.v1, tuple.v2, tuple.v3); | ||
| } | ||
|
|
||
| /** | ||
| * Apply this tuple as arguments to a function. | ||
| */ | ||
| public final <R> R map(Function13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, R> function) { | ||
| return function.apply(this); | ||
| } | ||
|
|
||
| /** | ||
| * Apply attribute 1 as argument to a function and return a new tuple with the substituted argument. | ||
| */ | ||
| public final <U1> Tuple13<U1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> map1(Function1<? super T1, ? extends U1> function) { | ||
| return Tuple.tuple(function.apply(v1), v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13); | ||
| } | ||
|
|
||
| /** | ||
| * Apply attribute 2 as argument to a function and return a new tuple with the substituted argument. | ||
| */ | ||
| public final <U2> Tuple13<T1, U2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> map2(Function1<? super T2, ? extends U2> function) { | ||
| return Tuple.tuple(v1, function.apply(v2), v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13); | ||
| } | ||
|
|
||
| /** | ||
| * Apply attribute 3 as argument to a function and return a new tuple with the substituted argument. | ||
| */ | ||
| public final <U3> Tuple13<T1, T2, U3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> map3(Function1<? super T3, ? extends U3> function) { | ||
| return Tuple.tuple(v1, v2, function.apply(v3), v4, v5, v6, v7, v8, v9, v10, v11, v12, v13); | ||
| } | ||
|
|
||
| /** | ||
| * Apply attribute 4 as argument to a function and return a new tuple with the substituted argument. | ||
| */ | ||
| public final <U4> Tuple13<T1, T2, T3, U4, T5, T6, T7, T8, T9, T10, T11, T12, T13> map4(Function1<? super T4, ? extends U4> function) { | ||
| return Tuple.tuple(v1, v2, v3, function.apply(v4), v5, v6, v7, v8, v9, v10, v11, v12, v13); | ||
| } | ||
|
|
||
| /** | ||
| * Apply attribute 5 as argument to a function and return a new tuple with the substituted argument. | ||
| */ | ||
| public final <U5> Tuple13<T1, T2, T3, T4, U5, T6, T7, T8, T9, T10, T11, T12, T13> map5(Function1<? super T5, ? extends U5> function) { | ||
| return Tuple.tuple(v1, v2, v3, v4, function.apply(v5), v6, v7, v8, v9, v10, v11, v12, v13); | ||
| } | ||
|
|
||
| /** | ||
| * Apply attribute 6 as argument to a function and return a new tuple with the substituted argument. | ||
| */ | ||
| public final <U6> Tuple13<T1, T2, T3, T4, T5, U6, T7, T8, T9, T10, T11, T12, T13> map6(Function1<? super T6, ? extends U6> function) { | ||
| return Tuple.tuple(v1, v2, v3, v4, v5, function.apply(v6), v7, v8, v9, v10, v11, v12, v13); | ||
| } | ||
|
|
||
| /** | ||
| * Apply attribute 7 as argument to a function and return a new tuple with the substituted argument. | ||
| */ | ||
| public final <U7> Tuple13<T1, T2, T3, T4, T5, T6, U7, T8, T9, T10, T11, T12, T13> map7(Function1<? super T7, ? extends U7> function) { | ||
| return Tuple.tuple(v1, v2, v3, v4, v5, v6, function.apply(v7), v8, v9, v10, v11, v12, v13); | ||
| } | ||
|
|
||
| /** | ||
| * Apply attribute 8 as argument to a function and return a new tuple with the substituted argument. | ||
| */ | ||
| public final <U8> Tuple13<T1, T2, T3, T4, T5, T6, T7, U8, T9, T10, T11, T12, T13> map8(Function1<? super T8, ? extends U8> function) { | ||
| return Tuple.tuple(v1, v2, v3, v4, v5, v6, v7, function.apply(v8), v9, v10, v11, v12, v13); | ||
| } | ||
|
|
||
| /** | ||
| * Apply attribute 9 as argument to a function and return a new tuple with the substituted argument. | ||
| */ | ||
| public final <U9> Tuple13<T1, T2, T3, T4, T5, T6, T7, T8, U9, T10, T11, T12, T13> map9(Function1<? super T9, ? extends U9> function) { | ||
| return Tuple.tuple(v1, v2, v3, v4, v5, v6, v7, v8, function.apply(v9), v10, v11, v12, v13); | ||
| } | ||
|
|
||
| /** | ||
| * Apply attribute 10 as argument to a function and return a new tuple with the substituted argument. | ||
| */ | ||
| public final <U10> Tuple13<T1, T2, T3, T4, T5, T6, T7, T8, T9, U10, T11, T12, T13> map10(Function1<? super T10, ? extends U10> function) { | ||
| return Tuple.tuple(v1, v2, v3, v4, v5, v6, v7, v8, v9, function.apply(v10), v11, v12, v13); | ||
| } | ||
|
|
||
| /** | ||
| * Apply attribute 11 as argument to a function and return a new tuple with the substituted argument. | ||
| */ | ||
| public final <U11> Tuple13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, U11, T12, T13> map11(Function1<? super T11, ? extends U11> function) { | ||
| return Tuple.tuple(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, function.apply(v11), v12, v13); | ||
| } | ||
|
|
||
| /** | ||
| * Apply attribute 12 as argument to a function and return a new tuple with the substituted argument. | ||
| */ | ||
| public final <U12> Tuple13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, U12, T13> map12(Function1<? super T12, ? extends U12> function) { | ||
| return Tuple.tuple(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, function.apply(v12), v13); | ||
| } | ||
|
|
||
| /** | ||
| * Apply attribute 13 as argument to a function and return a new tuple with the substituted argument. | ||
| */ | ||
| public final <U13> Tuple13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, U13> map13(Function1<? super T13, ? extends U13> function) { | ||
| return Tuple.tuple(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, function.apply(v13)); | ||
| } | ||
|
|
||
| @Override | ||
| public final Object[] array() { | ||
| return new Object[] { v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13 }; | ||
| } | ||
|
|
||
| @Override | ||
| public final List<?> list() { | ||
| return Arrays.asList(array()); | ||
| } | ||
|
|
||
| /** | ||
| * The degree of this tuple: 13. | ||
| */ | ||
| @Override | ||
| public final int degree() { | ||
| return 13; | ||
| } | ||
|
|
||
| @Override | ||
| @SuppressWarnings("unchecked") | ||
| public final Iterator<Object> iterator() { | ||
| return (Iterator<Object>) list().iterator(); | ||
| } | ||
|
|
||
| @Override | ||
| public int compareTo(Tuple13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> other) { | ||
| int result = 0; | ||
|
|
||
| result = Tuples.compare(v1, other.v1); if (result != 0) return result; | ||
| result = Tuples.compare(v2, other.v2); if (result != 0) return result; | ||
| result = Tuples.compare(v3, other.v3); if (result != 0) return result; | ||
| result = Tuples.compare(v4, other.v4); if (result != 0) return result; | ||
| result = Tuples.compare(v5, other.v5); if (result != 0) return result; | ||
| result = Tuples.compare(v6, other.v6); if (result != 0) return result; | ||
| result = Tuples.compare(v7, other.v7); if (result != 0) return result; | ||
| result = Tuples.compare(v8, other.v8); if (result != 0) return result; | ||
| result = Tuples.compare(v9, other.v9); if (result != 0) return result; | ||
| result = Tuples.compare(v10, other.v10); if (result != 0) return result; | ||
| result = Tuples.compare(v11, other.v11); if (result != 0) return result; | ||
| result = Tuples.compare(v12, other.v12); if (result != 0) return result; | ||
| result = Tuples.compare(v13, other.v13); if (result != 0) return result; | ||
|
|
||
| return result; | ||
| } | ||
|
|
||
| @Override | ||
| public boolean equals(Object o) { | ||
| if (this == o) | ||
| return true; | ||
| if (!(o instanceof Tuple13)) | ||
| return false; | ||
|
|
||
| @SuppressWarnings({ "unchecked", "rawtypes" }) | ||
| final Tuple13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> that = (Tuple13) o; | ||
|
|
||
| if (!Objects.equals(v1, that.v1)) return false; | ||
| if (!Objects.equals(v2, that.v2)) return false; | ||
| if (!Objects.equals(v3, that.v3)) return false; | ||
| if (!Objects.equals(v4, that.v4)) return false; | ||
| if (!Objects.equals(v5, that.v5)) return false; | ||
| if (!Objects.equals(v6, that.v6)) return false; | ||
| if (!Objects.equals(v7, that.v7)) return false; | ||
| if (!Objects.equals(v8, that.v8)) return false; | ||
| if (!Objects.equals(v9, that.v9)) return false; | ||
| if (!Objects.equals(v10, that.v10)) return false; | ||
| if (!Objects.equals(v11, that.v11)) return false; | ||
| if (!Objects.equals(v12, that.v12)) return false; | ||
| if (!Objects.equals(v13, that.v13)) return false; | ||
|
|
||
| return true; | ||
| } | ||
|
|
||
| @Override | ||
| public int hashCode() { | ||
| final int prime = 31; | ||
| int result = 1; | ||
|
|
||
| result = prime * result + ((v1 == null) ? 0 : v1.hashCode()); | ||
| result = prime * result + ((v2 == null) ? 0 : v2.hashCode()); | ||
| result = prime * result + ((v3 == null) ? 0 : v3.hashCode()); | ||
| result = prime * result + ((v4 == null) ? 0 : v4.hashCode()); | ||
| result = prime * result + ((v5 == null) ? 0 : v5.hashCode()); | ||
| result = prime * result + ((v6 == null) ? 0 : v6.hashCode()); | ||
| result = prime * result + ((v7 == null) ? 0 : v7.hashCode()); | ||
| result = prime * result + ((v8 == null) ? 0 : v8.hashCode()); | ||
| result = prime * result + ((v9 == null) ? 0 : v9.hashCode()); | ||
| result = prime * result + ((v10 == null) ? 0 : v10.hashCode()); | ||
| result = prime * result + ((v11 == null) ? 0 : v11.hashCode()); | ||
| result = prime * result + ((v12 == null) ? 0 : v12.hashCode()); | ||
| result = prime * result + ((v13 == null) ? 0 : v13.hashCode()); | ||
|
|
||
| return result; | ||
| } | ||
|
|
||
| @Override | ||
| public String toString() { | ||
| return "(" | ||
| + v1 | ||
| + ", " + v2 | ||
| + ", " + v3 | ||
| + ", " + v4 | ||
| + ", " + v5 | ||
| + ", " + v6 | ||
| + ", " + v7 | ||
| + ", " + v8 | ||
| + ", " + v9 | ||
| + ", " + v10 | ||
| + ", " + v11 | ||
| + ", " + v12 | ||
| + ", " + v13 | ||
| + ")"; | ||
| } | ||
|
|
||
| @Override | ||
| public Tuple13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> clone() { | ||
| return new Tuple13<>(this); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,388 @@ | ||
| /** | ||
| * Copyright (c) 2014-2015, Data Geekery GmbH, contact@datageekery.com | ||
| * | ||
| * Licensed 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.jooq.lambda.tuple; | ||
|
|
||
| import java.io.Serializable; | ||
| import java.util.Arrays; | ||
| import java.util.Iterator; | ||
| import java.util.List; | ||
| import java.util.Objects; | ||
|
|
||
| import org.jooq.lambda.function.Function1; | ||
| import org.jooq.lambda.function.Function14; | ||
|
|
||
| /** | ||
| * A tuple of degree 14. | ||
| * | ||
| * @author Lukas Eder | ||
| */ | ||
| public class Tuple14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> implements Tuple, Comparable<Tuple14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>>, Serializable, Cloneable { | ||
|
|
||
| private static final long serialVersionUID = 1L; | ||
|
|
||
| public final T1 v1; | ||
| public final T2 v2; | ||
| public final T3 v3; | ||
| public final T4 v4; | ||
| public final T5 v5; | ||
| public final T6 v6; | ||
| public final T7 v7; | ||
| public final T8 v8; | ||
| public final T9 v9; | ||
| public final T10 v10; | ||
| public final T11 v11; | ||
| public final T12 v12; | ||
| public final T13 v13; | ||
| public final T14 v14; | ||
|
|
||
| public T1 v1() { | ||
| return v1; | ||
| } | ||
|
|
||
| public T2 v2() { | ||
| return v2; | ||
| } | ||
|
|
||
| public T3 v3() { | ||
| return v3; | ||
| } | ||
|
|
||
| public T4 v4() { | ||
| return v4; | ||
| } | ||
|
|
||
| public T5 v5() { | ||
| return v5; | ||
| } | ||
|
|
||
| public T6 v6() { | ||
| return v6; | ||
| } | ||
|
|
||
| public T7 v7() { | ||
| return v7; | ||
| } | ||
|
|
||
| public T8 v8() { | ||
| return v8; | ||
| } | ||
|
|
||
| public T9 v9() { | ||
| return v9; | ||
| } | ||
|
|
||
| public T10 v10() { | ||
| return v10; | ||
| } | ||
|
|
||
| public T11 v11() { | ||
| return v11; | ||
| } | ||
|
|
||
| public T12 v12() { | ||
| return v12; | ||
| } | ||
|
|
||
| public T13 v13() { | ||
| return v13; | ||
| } | ||
|
|
||
| public T14 v14() { | ||
| return v14; | ||
| } | ||
|
|
||
| public Tuple14(Tuple14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> tuple) { | ||
| this.v1 = tuple.v1; | ||
| this.v2 = tuple.v2; | ||
| this.v3 = tuple.v3; | ||
| this.v4 = tuple.v4; | ||
| this.v5 = tuple.v5; | ||
| this.v6 = tuple.v6; | ||
| this.v7 = tuple.v7; | ||
| this.v8 = tuple.v8; | ||
| this.v9 = tuple.v9; | ||
| this.v10 = tuple.v10; | ||
| this.v11 = tuple.v11; | ||
| this.v12 = tuple.v12; | ||
| this.v13 = tuple.v13; | ||
| this.v14 = tuple.v14; | ||
| } | ||
|
|
||
| public Tuple14(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) { | ||
| this.v1 = v1; | ||
| this.v2 = v2; | ||
| this.v3 = v3; | ||
| this.v4 = v4; | ||
| this.v5 = v5; | ||
| this.v6 = v6; | ||
| this.v7 = v7; | ||
| this.v8 = v8; | ||
| this.v9 = v9; | ||
| this.v10 = v10; | ||
| this.v11 = v11; | ||
| this.v12 = v12; | ||
| this.v13 = v13; | ||
| this.v14 = v14; | ||
| } | ||
|
|
||
| /** | ||
| * Concatenate a value to this tuple. | ||
| */ | ||
| public final <T15> Tuple15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> concat(T15 value) { | ||
| return new Tuple15<>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, value); | ||
| } | ||
|
|
||
| /** | ||
| * Concatenate a tuple to this tuple. | ||
| */ | ||
| public final <T15> Tuple15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> concat(Tuple1<T15> tuple) { | ||
| return new Tuple15<>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, tuple.v1); | ||
| } | ||
|
|
||
| /** | ||
| * Concatenate a tuple to this tuple. | ||
| */ | ||
| public final <T15, T16> Tuple16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> concat(Tuple2<T15, T16> tuple) { | ||
| return new Tuple16<>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, tuple.v1, tuple.v2); | ||
| } | ||
|
|
||
| /** | ||
| * Apply this tuple as arguments to a function. | ||
| */ | ||
| public final <R> R map(Function14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, R> function) { | ||
| return function.apply(this); | ||
| } | ||
|
|
||
| /** | ||
| * Apply attribute 1 as argument to a function and return a new tuple with the substituted argument. | ||
| */ | ||
| public final <U1> Tuple14<U1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> map1(Function1<? super T1, ? extends U1> function) { | ||
| return Tuple.tuple(function.apply(v1), v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14); | ||
| } | ||
|
|
||
| /** | ||
| * Apply attribute 2 as argument to a function and return a new tuple with the substituted argument. | ||
| */ | ||
| public final <U2> Tuple14<T1, U2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> map2(Function1<? super T2, ? extends U2> function) { | ||
| return Tuple.tuple(v1, function.apply(v2), v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14); | ||
| } | ||
|
|
||
| /** | ||
| * Apply attribute 3 as argument to a function and return a new tuple with the substituted argument. | ||
| */ | ||
| public final <U3> Tuple14<T1, T2, U3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> map3(Function1<? super T3, ? extends U3> function) { | ||
| return Tuple.tuple(v1, v2, function.apply(v3), v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14); | ||
| } | ||
|
|
||
| /** | ||
| * Apply attribute 4 as argument to a function and return a new tuple with the substituted argument. | ||
| */ | ||
| public final <U4> Tuple14<T1, T2, T3, U4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> map4(Function1<? super T4, ? extends U4> function) { | ||
| return Tuple.tuple(v1, v2, v3, function.apply(v4), v5, v6, v7, v8, v9, v10, v11, v12, v13, v14); | ||
| } | ||
|
|
||
| /** | ||
| * Apply attribute 5 as argument to a function and return a new tuple with the substituted argument. | ||
| */ | ||
| public final <U5> Tuple14<T1, T2, T3, T4, U5, T6, T7, T8, T9, T10, T11, T12, T13, T14> map5(Function1<? super T5, ? extends U5> function) { | ||
| return Tuple.tuple(v1, v2, v3, v4, function.apply(v5), v6, v7, v8, v9, v10, v11, v12, v13, v14); | ||
| } | ||
|
|
||
| /** | ||
| * Apply attribute 6 as argument to a function and return a new tuple with the substituted argument. | ||
| */ | ||
| public final <U6> Tuple14<T1, T2, T3, T4, T5, U6, T7, T8, T9, T10, T11, T12, T13, T14> map6(Function1<? super T6, ? extends U6> function) { | ||
| return Tuple.tuple(v1, v2, v3, v4, v5, function.apply(v6), v7, v8, v9, v10, v11, v12, v13, v14); | ||
| } | ||
|
|
||
| /** | ||
| * Apply attribute 7 as argument to a function and return a new tuple with the substituted argument. | ||
| */ | ||
| public final <U7> Tuple14<T1, T2, T3, T4, T5, T6, U7, T8, T9, T10, T11, T12, T13, T14> map7(Function1<? super T7, ? extends U7> function) { | ||
| return Tuple.tuple(v1, v2, v3, v4, v5, v6, function.apply(v7), v8, v9, v10, v11, v12, v13, v14); | ||
| } | ||
|
|
||
| /** | ||
| * Apply attribute 8 as argument to a function and return a new tuple with the substituted argument. | ||
| */ | ||
| public final <U8> Tuple14<T1, T2, T3, T4, T5, T6, T7, U8, T9, T10, T11, T12, T13, T14> map8(Function1<? super T8, ? extends U8> function) { | ||
| return Tuple.tuple(v1, v2, v3, v4, v5, v6, v7, function.apply(v8), v9, v10, v11, v12, v13, v14); | ||
| } | ||
|
|
||
| /** | ||
| * Apply attribute 9 as argument to a function and return a new tuple with the substituted argument. | ||
| */ | ||
| public final <U9> Tuple14<T1, T2, T3, T4, T5, T6, T7, T8, U9, T10, T11, T12, T13, T14> map9(Function1<? super T9, ? extends U9> function) { | ||
| return Tuple.tuple(v1, v2, v3, v4, v5, v6, v7, v8, function.apply(v9), v10, v11, v12, v13, v14); | ||
| } | ||
|
|
||
| /** | ||
| * Apply attribute 10 as argument to a function and return a new tuple with the substituted argument. | ||
| */ | ||
| public final <U10> Tuple14<T1, T2, T3, T4, T5, T6, T7, T8, T9, U10, T11, T12, T13, T14> map10(Function1<? super T10, ? extends U10> function) { | ||
| return Tuple.tuple(v1, v2, v3, v4, v5, v6, v7, v8, v9, function.apply(v10), v11, v12, v13, v14); | ||
| } | ||
|
|
||
| /** | ||
| * Apply attribute 11 as argument to a function and return a new tuple with the substituted argument. | ||
| */ | ||
| public final <U11> Tuple14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, U11, T12, T13, T14> map11(Function1<? super T11, ? extends U11> function) { | ||
| return Tuple.tuple(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, function.apply(v11), v12, v13, v14); | ||
| } | ||
|
|
||
| /** | ||
| * Apply attribute 12 as argument to a function and return a new tuple with the substituted argument. | ||
| */ | ||
| public final <U12> Tuple14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, U12, T13, T14> map12(Function1<? super T12, ? extends U12> function) { | ||
| return Tuple.tuple(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, function.apply(v12), v13, v14); | ||
| } | ||
|
|
||
| /** | ||
| * Apply attribute 13 as argument to a function and return a new tuple with the substituted argument. | ||
| */ | ||
| public final <U13> Tuple14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, U13, T14> map13(Function1<? super T13, ? extends U13> function) { | ||
| return Tuple.tuple(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, function.apply(v13), v14); | ||
| } | ||
|
|
||
| /** | ||
| * Apply attribute 14 as argument to a function and return a new tuple with the substituted argument. | ||
| */ | ||
| public final <U14> Tuple14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, U14> map14(Function1<? super T14, ? extends U14> function) { | ||
| return Tuple.tuple(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, function.apply(v14)); | ||
| } | ||
|
|
||
| @Override | ||
| public final Object[] array() { | ||
| return new Object[] { v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14 }; | ||
| } | ||
|
|
||
| @Override | ||
| public final List<?> list() { | ||
| return Arrays.asList(array()); | ||
| } | ||
|
|
||
| /** | ||
| * The degree of this tuple: 14. | ||
| */ | ||
| @Override | ||
| public final int degree() { | ||
| return 14; | ||
| } | ||
|
|
||
| @Override | ||
| @SuppressWarnings("unchecked") | ||
| public final Iterator<Object> iterator() { | ||
| return (Iterator<Object>) list().iterator(); | ||
| } | ||
|
|
||
| @Override | ||
| public int compareTo(Tuple14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> other) { | ||
| int result = 0; | ||
|
|
||
| result = Tuples.compare(v1, other.v1); if (result != 0) return result; | ||
| result = Tuples.compare(v2, other.v2); if (result != 0) return result; | ||
| result = Tuples.compare(v3, other.v3); if (result != 0) return result; | ||
| result = Tuples.compare(v4, other.v4); if (result != 0) return result; | ||
| result = Tuples.compare(v5, other.v5); if (result != 0) return result; | ||
| result = Tuples.compare(v6, other.v6); if (result != 0) return result; | ||
| result = Tuples.compare(v7, other.v7); if (result != 0) return result; | ||
| result = Tuples.compare(v8, other.v8); if (result != 0) return result; | ||
| result = Tuples.compare(v9, other.v9); if (result != 0) return result; | ||
| result = Tuples.compare(v10, other.v10); if (result != 0) return result; | ||
| result = Tuples.compare(v11, other.v11); if (result != 0) return result; | ||
| result = Tuples.compare(v12, other.v12); if (result != 0) return result; | ||
| result = Tuples.compare(v13, other.v13); if (result != 0) return result; | ||
| result = Tuples.compare(v14, other.v14); if (result != 0) return result; | ||
|
|
||
| return result; | ||
| } | ||
|
|
||
| @Override | ||
| public boolean equals(Object o) { | ||
| if (this == o) | ||
| return true; | ||
| if (!(o instanceof Tuple14)) | ||
| return false; | ||
|
|
||
| @SuppressWarnings({ "unchecked", "rawtypes" }) | ||
| final Tuple14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> that = (Tuple14) o; | ||
|
|
||
| if (!Objects.equals(v1, that.v1)) return false; | ||
| if (!Objects.equals(v2, that.v2)) return false; | ||
| if (!Objects.equals(v3, that.v3)) return false; | ||
| if (!Objects.equals(v4, that.v4)) return false; | ||
| if (!Objects.equals(v5, that.v5)) return false; | ||
| if (!Objects.equals(v6, that.v6)) return false; | ||
| if (!Objects.equals(v7, that.v7)) return false; | ||
| if (!Objects.equals(v8, that.v8)) return false; | ||
| if (!Objects.equals(v9, that.v9)) return false; | ||
| if (!Objects.equals(v10, that.v10)) return false; | ||
| if (!Objects.equals(v11, that.v11)) return false; | ||
| if (!Objects.equals(v12, that.v12)) return false; | ||
| if (!Objects.equals(v13, that.v13)) return false; | ||
| if (!Objects.equals(v14, that.v14)) return false; | ||
|
|
||
| return true; | ||
| } | ||
|
|
||
| @Override | ||
| public int hashCode() { | ||
| final int prime = 31; | ||
| int result = 1; | ||
|
|
||
| result = prime * result + ((v1 == null) ? 0 : v1.hashCode()); | ||
| result = prime * result + ((v2 == null) ? 0 : v2.hashCode()); | ||
| result = prime * result + ((v3 == null) ? 0 : v3.hashCode()); | ||
| result = prime * result + ((v4 == null) ? 0 : v4.hashCode()); | ||
| result = prime * result + ((v5 == null) ? 0 : v5.hashCode()); | ||
| result = prime * result + ((v6 == null) ? 0 : v6.hashCode()); | ||
| result = prime * result + ((v7 == null) ? 0 : v7.hashCode()); | ||
| result = prime * result + ((v8 == null) ? 0 : v8.hashCode()); | ||
| result = prime * result + ((v9 == null) ? 0 : v9.hashCode()); | ||
| result = prime * result + ((v10 == null) ? 0 : v10.hashCode()); | ||
| result = prime * result + ((v11 == null) ? 0 : v11.hashCode()); | ||
| result = prime * result + ((v12 == null) ? 0 : v12.hashCode()); | ||
| result = prime * result + ((v13 == null) ? 0 : v13.hashCode()); | ||
| result = prime * result + ((v14 == null) ? 0 : v14.hashCode()); | ||
|
|
||
| return result; | ||
| } | ||
|
|
||
| @Override | ||
| public String toString() { | ||
| return "(" | ||
| + v1 | ||
| + ", " + v2 | ||
| + ", " + v3 | ||
| + ", " + v4 | ||
| + ", " + v5 | ||
| + ", " + v6 | ||
| + ", " + v7 | ||
| + ", " + v8 | ||
| + ", " + v9 | ||
| + ", " + v10 | ||
| + ", " + v11 | ||
| + ", " + v12 | ||
| + ", " + v13 | ||
| + ", " + v14 | ||
| + ")"; | ||
| } | ||
|
|
||
| @Override | ||
| public Tuple14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> clone() { | ||
| return new Tuple14<>(this); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,399 @@ | ||
| /** | ||
| * Copyright (c) 2014-2015, Data Geekery GmbH, contact@datageekery.com | ||
| * | ||
| * Licensed 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.jooq.lambda.tuple; | ||
|
|
||
| import java.io.Serializable; | ||
| import java.util.Arrays; | ||
| import java.util.Iterator; | ||
| import java.util.List; | ||
| import java.util.Objects; | ||
|
|
||
| import org.jooq.lambda.function.Function1; | ||
| import org.jooq.lambda.function.Function15; | ||
|
|
||
| /** | ||
| * A tuple of degree 15. | ||
| * | ||
| * @author Lukas Eder | ||
| */ | ||
| public class Tuple15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> implements Tuple, Comparable<Tuple15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>>, Serializable, Cloneable { | ||
|
|
||
| private static final long serialVersionUID = 1L; | ||
|
|
||
| public final T1 v1; | ||
| public final T2 v2; | ||
| public final T3 v3; | ||
| public final T4 v4; | ||
| public final T5 v5; | ||
| public final T6 v6; | ||
| public final T7 v7; | ||
| public final T8 v8; | ||
| public final T9 v9; | ||
| public final T10 v10; | ||
| public final T11 v11; | ||
| public final T12 v12; | ||
| public final T13 v13; | ||
| public final T14 v14; | ||
| public final T15 v15; | ||
|
|
||
| public T1 v1() { | ||
| return v1; | ||
| } | ||
|
|
||
| public T2 v2() { | ||
| return v2; | ||
| } | ||
|
|
||
| public T3 v3() { | ||
| return v3; | ||
| } | ||
|
|
||
| public T4 v4() { | ||
| return v4; | ||
| } | ||
|
|
||
| public T5 v5() { | ||
| return v5; | ||
| } | ||
|
|
||
| public T6 v6() { | ||
| return v6; | ||
| } | ||
|
|
||
| public T7 v7() { | ||
| return v7; | ||
| } | ||
|
|
||
| public T8 v8() { | ||
| return v8; | ||
| } | ||
|
|
||
| public T9 v9() { | ||
| return v9; | ||
| } | ||
|
|
||
| public T10 v10() { | ||
| return v10; | ||
| } | ||
|
|
||
| public T11 v11() { | ||
| return v11; | ||
| } | ||
|
|
||
| public T12 v12() { | ||
| return v12; | ||
| } | ||
|
|
||
| public T13 v13() { | ||
| return v13; | ||
| } | ||
|
|
||
| public T14 v14() { | ||
| return v14; | ||
| } | ||
|
|
||
| public T15 v15() { | ||
| return v15; | ||
| } | ||
|
|
||
| public Tuple15(Tuple15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> tuple) { | ||
| this.v1 = tuple.v1; | ||
| this.v2 = tuple.v2; | ||
| this.v3 = tuple.v3; | ||
| this.v4 = tuple.v4; | ||
| this.v5 = tuple.v5; | ||
| this.v6 = tuple.v6; | ||
| this.v7 = tuple.v7; | ||
| this.v8 = tuple.v8; | ||
| this.v9 = tuple.v9; | ||
| this.v10 = tuple.v10; | ||
| this.v11 = tuple.v11; | ||
| this.v12 = tuple.v12; | ||
| this.v13 = tuple.v13; | ||
| this.v14 = tuple.v14; | ||
| this.v15 = tuple.v15; | ||
| } | ||
|
|
||
| public Tuple15(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) { | ||
| this.v1 = v1; | ||
| this.v2 = v2; | ||
| this.v3 = v3; | ||
| this.v4 = v4; | ||
| this.v5 = v5; | ||
| this.v6 = v6; | ||
| this.v7 = v7; | ||
| this.v8 = v8; | ||
| this.v9 = v9; | ||
| this.v10 = v10; | ||
| this.v11 = v11; | ||
| this.v12 = v12; | ||
| this.v13 = v13; | ||
| this.v14 = v14; | ||
| this.v15 = v15; | ||
| } | ||
|
|
||
| /** | ||
| * Concatenate a value to this tuple. | ||
| */ | ||
| public final <T16> Tuple16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> concat(T16 value) { | ||
| return new Tuple16<>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, value); | ||
| } | ||
|
|
||
| /** | ||
| * Concatenate a tuple to this tuple. | ||
| */ | ||
| public final <T16> Tuple16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> concat(Tuple1<T16> tuple) { | ||
| return new Tuple16<>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, tuple.v1); | ||
| } | ||
|
|
||
| /** | ||
| * Apply this tuple as arguments to a function. | ||
| */ | ||
| public final <R> R map(Function15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, R> function) { | ||
| return function.apply(this); | ||
| } | ||
|
|
||
| /** | ||
| * Apply attribute 1 as argument to a function and return a new tuple with the substituted argument. | ||
| */ | ||
| public final <U1> Tuple15<U1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> map1(Function1<? super T1, ? extends U1> function) { | ||
| return Tuple.tuple(function.apply(v1), v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15); | ||
| } | ||
|
|
||
| /** | ||
| * Apply attribute 2 as argument to a function and return a new tuple with the substituted argument. | ||
| */ | ||
| public final <U2> Tuple15<T1, U2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> map2(Function1<? super T2, ? extends U2> function) { | ||
| return Tuple.tuple(v1, function.apply(v2), v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15); | ||
| } | ||
|
|
||
| /** | ||
| * Apply attribute 3 as argument to a function and return a new tuple with the substituted argument. | ||
| */ | ||
| public final <U3> Tuple15<T1, T2, U3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> map3(Function1<? super T3, ? extends U3> function) { | ||
| return Tuple.tuple(v1, v2, function.apply(v3), v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15); | ||
| } | ||
|
|
||
| /** | ||
| * Apply attribute 4 as argument to a function and return a new tuple with the substituted argument. | ||
| */ | ||
| public final <U4> Tuple15<T1, T2, T3, U4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> map4(Function1<? super T4, ? extends U4> function) { | ||
| return Tuple.tuple(v1, v2, v3, function.apply(v4), v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15); | ||
| } | ||
|
|
||
| /** | ||
| * Apply attribute 5 as argument to a function and return a new tuple with the substituted argument. | ||
| */ | ||
| public final <U5> Tuple15<T1, T2, T3, T4, U5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> map5(Function1<? super T5, ? extends U5> function) { | ||
| return Tuple.tuple(v1, v2, v3, v4, function.apply(v5), v6, v7, v8, v9, v10, v11, v12, v13, v14, v15); | ||
| } | ||
|
|
||
| /** | ||
| * Apply attribute 6 as argument to a function and return a new tuple with the substituted argument. | ||
| */ | ||
| public final <U6> Tuple15<T1, T2, T3, T4, T5, U6, T7, T8, T9, T10, T11, T12, T13, T14, T15> map6(Function1<? super T6, ? extends U6> function) { | ||
| return Tuple.tuple(v1, v2, v3, v4, v5, function.apply(v6), v7, v8, v9, v10, v11, v12, v13, v14, v15); | ||
| } | ||
|
|
||
| /** | ||
| * Apply attribute 7 as argument to a function and return a new tuple with the substituted argument. | ||
| */ | ||
| public final <U7> Tuple15<T1, T2, T3, T4, T5, T6, U7, T8, T9, T10, T11, T12, T13, T14, T15> map7(Function1<? super T7, ? extends U7> function) { | ||
| return Tuple.tuple(v1, v2, v3, v4, v5, v6, function.apply(v7), v8, v9, v10, v11, v12, v13, v14, v15); | ||
| } | ||
|
|
||
| /** | ||
| * Apply attribute 8 as argument to a function and return a new tuple with the substituted argument. | ||
| */ | ||
| public final <U8> Tuple15<T1, T2, T3, T4, T5, T6, T7, U8, T9, T10, T11, T12, T13, T14, T15> map8(Function1<? super T8, ? extends U8> function) { | ||
| return Tuple.tuple(v1, v2, v3, v4, v5, v6, v7, function.apply(v8), v9, v10, v11, v12, v13, v14, v15); | ||
| } | ||
|
|
||
| /** | ||
| * Apply attribute 9 as argument to a function and return a new tuple with the substituted argument. | ||
| */ | ||
| public final <U9> Tuple15<T1, T2, T3, T4, T5, T6, T7, T8, U9, T10, T11, T12, T13, T14, T15> map9(Function1<? super T9, ? extends U9> function) { | ||
| return Tuple.tuple(v1, v2, v3, v4, v5, v6, v7, v8, function.apply(v9), v10, v11, v12, v13, v14, v15); | ||
| } | ||
|
|
||
| /** | ||
| * Apply attribute 10 as argument to a function and return a new tuple with the substituted argument. | ||
| */ | ||
| public final <U10> Tuple15<T1, T2, T3, T4, T5, T6, T7, T8, T9, U10, T11, T12, T13, T14, T15> map10(Function1<? super T10, ? extends U10> function) { | ||
| return Tuple.tuple(v1, v2, v3, v4, v5, v6, v7, v8, v9, function.apply(v10), v11, v12, v13, v14, v15); | ||
| } | ||
|
|
||
| /** | ||
| * Apply attribute 11 as argument to a function and return a new tuple with the substituted argument. | ||
| */ | ||
| public final <U11> Tuple15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, U11, T12, T13, T14, T15> map11(Function1<? super T11, ? extends U11> function) { | ||
| return Tuple.tuple(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, function.apply(v11), v12, v13, v14, v15); | ||
| } | ||
|
|
||
| /** | ||
| * Apply attribute 12 as argument to a function and return a new tuple with the substituted argument. | ||
| */ | ||
| public final <U12> Tuple15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, U12, T13, T14, T15> map12(Function1<? super T12, ? extends U12> function) { | ||
| return Tuple.tuple(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, function.apply(v12), v13, v14, v15); | ||
| } | ||
|
|
||
| /** | ||
| * Apply attribute 13 as argument to a function and return a new tuple with the substituted argument. | ||
| */ | ||
| public final <U13> Tuple15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, U13, T14, T15> map13(Function1<? super T13, ? extends U13> function) { | ||
| return Tuple.tuple(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, function.apply(v13), v14, v15); | ||
| } | ||
|
|
||
| /** | ||
| * Apply attribute 14 as argument to a function and return a new tuple with the substituted argument. | ||
| */ | ||
| public final <U14> Tuple15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, U14, T15> map14(Function1<? super T14, ? extends U14> function) { | ||
| return Tuple.tuple(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, function.apply(v14), v15); | ||
| } | ||
|
|
||
| /** | ||
| * Apply attribute 15 as argument to a function and return a new tuple with the substituted argument. | ||
| */ | ||
| public final <U15> Tuple15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, U15> map15(Function1<? super T15, ? extends U15> function) { | ||
| return Tuple.tuple(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, function.apply(v15)); | ||
| } | ||
|
|
||
| @Override | ||
| public final Object[] array() { | ||
| return new Object[] { v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15 }; | ||
| } | ||
|
|
||
| @Override | ||
| public final List<?> list() { | ||
| return Arrays.asList(array()); | ||
| } | ||
|
|
||
| /** | ||
| * The degree of this tuple: 15. | ||
| */ | ||
| @Override | ||
| public final int degree() { | ||
| return 15; | ||
| } | ||
|
|
||
| @Override | ||
| @SuppressWarnings("unchecked") | ||
| public final Iterator<Object> iterator() { | ||
| return (Iterator<Object>) list().iterator(); | ||
| } | ||
|
|
||
| @Override | ||
| public int compareTo(Tuple15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> other) { | ||
| int result = 0; | ||
|
|
||
| result = Tuples.compare(v1, other.v1); if (result != 0) return result; | ||
| result = Tuples.compare(v2, other.v2); if (result != 0) return result; | ||
| result = Tuples.compare(v3, other.v3); if (result != 0) return result; | ||
| result = Tuples.compare(v4, other.v4); if (result != 0) return result; | ||
| result = Tuples.compare(v5, other.v5); if (result != 0) return result; | ||
| result = Tuples.compare(v6, other.v6); if (result != 0) return result; | ||
| result = Tuples.compare(v7, other.v7); if (result != 0) return result; | ||
| result = Tuples.compare(v8, other.v8); if (result != 0) return result; | ||
| result = Tuples.compare(v9, other.v9); if (result != 0) return result; | ||
| result = Tuples.compare(v10, other.v10); if (result != 0) return result; | ||
| result = Tuples.compare(v11, other.v11); if (result != 0) return result; | ||
| result = Tuples.compare(v12, other.v12); if (result != 0) return result; | ||
| result = Tuples.compare(v13, other.v13); if (result != 0) return result; | ||
| result = Tuples.compare(v14, other.v14); if (result != 0) return result; | ||
| result = Tuples.compare(v15, other.v15); if (result != 0) return result; | ||
|
|
||
| return result; | ||
| } | ||
|
|
||
| @Override | ||
| public boolean equals(Object o) { | ||
| if (this == o) | ||
| return true; | ||
| if (!(o instanceof Tuple15)) | ||
| return false; | ||
|
|
||
| @SuppressWarnings({ "unchecked", "rawtypes" }) | ||
| final Tuple15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> that = (Tuple15) o; | ||
|
|
||
| if (!Objects.equals(v1, that.v1)) return false; | ||
| if (!Objects.equals(v2, that.v2)) return false; | ||
| if (!Objects.equals(v3, that.v3)) return false; | ||
| if (!Objects.equals(v4, that.v4)) return false; | ||
| if (!Objects.equals(v5, that.v5)) return false; | ||
| if (!Objects.equals(v6, that.v6)) return false; | ||
| if (!Objects.equals(v7, that.v7)) return false; | ||
| if (!Objects.equals(v8, that.v8)) return false; | ||
| if (!Objects.equals(v9, that.v9)) return false; | ||
| if (!Objects.equals(v10, that.v10)) return false; | ||
| if (!Objects.equals(v11, that.v11)) return false; | ||
| if (!Objects.equals(v12, that.v12)) return false; | ||
| if (!Objects.equals(v13, that.v13)) return false; | ||
| if (!Objects.equals(v14, that.v14)) return false; | ||
| if (!Objects.equals(v15, that.v15)) return false; | ||
|
|
||
| return true; | ||
| } | ||
|
|
||
| @Override | ||
| public int hashCode() { | ||
| final int prime = 31; | ||
| int result = 1; | ||
|
|
||
| result = prime * result + ((v1 == null) ? 0 : v1.hashCode()); | ||
| result = prime * result + ((v2 == null) ? 0 : v2.hashCode()); | ||
| result = prime * result + ((v3 == null) ? 0 : v3.hashCode()); | ||
| result = prime * result + ((v4 == null) ? 0 : v4.hashCode()); | ||
| result = prime * result + ((v5 == null) ? 0 : v5.hashCode()); | ||
| result = prime * result + ((v6 == null) ? 0 : v6.hashCode()); | ||
| result = prime * result + ((v7 == null) ? 0 : v7.hashCode()); | ||
| result = prime * result + ((v8 == null) ? 0 : v8.hashCode()); | ||
| result = prime * result + ((v9 == null) ? 0 : v9.hashCode()); | ||
| result = prime * result + ((v10 == null) ? 0 : v10.hashCode()); | ||
| result = prime * result + ((v11 == null) ? 0 : v11.hashCode()); | ||
| result = prime * result + ((v12 == null) ? 0 : v12.hashCode()); | ||
| result = prime * result + ((v13 == null) ? 0 : v13.hashCode()); | ||
| result = prime * result + ((v14 == null) ? 0 : v14.hashCode()); | ||
| result = prime * result + ((v15 == null) ? 0 : v15.hashCode()); | ||
|
|
||
| return result; | ||
| } | ||
|
|
||
| @Override | ||
| public String toString() { | ||
| return "(" | ||
| + v1 | ||
| + ", " + v2 | ||
| + ", " + v3 | ||
| + ", " + v4 | ||
| + ", " + v5 | ||
| + ", " + v6 | ||
| + ", " + v7 | ||
| + ", " + v8 | ||
| + ", " + v9 | ||
| + ", " + v10 | ||
| + ", " + v11 | ||
| + ", " + v12 | ||
| + ", " + v13 | ||
| + ", " + v14 | ||
| + ", " + v15 | ||
| + ")"; | ||
| } | ||
|
|
||
| @Override | ||
| public Tuple15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> clone() { | ||
| return new Tuple15<>(this); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,333 @@ | ||
| /** | ||
| * Copyright (c) 2014-2015, Data Geekery GmbH, contact@datageekery.com | ||
| * | ||
| * Licensed 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.jooq.lambda.tuple; | ||
|
|
||
| import java.io.Serializable; | ||
| import java.util.Arrays; | ||
| import java.util.Iterator; | ||
| import java.util.List; | ||
| import java.util.Objects; | ||
|
|
||
| import org.jooq.lambda.function.Function1; | ||
| import org.jooq.lambda.function.Function9; | ||
|
|
||
| /** | ||
| * A tuple of degree 9. | ||
| * | ||
| * @author Lukas Eder | ||
| */ | ||
| public class Tuple9<T1, T2, T3, T4, T5, T6, T7, T8, T9> implements Tuple, Comparable<Tuple9<T1, T2, T3, T4, T5, T6, T7, T8, T9>>, Serializable, Cloneable { | ||
|
|
||
| private static final long serialVersionUID = 1L; | ||
|
|
||
| public final T1 v1; | ||
| public final T2 v2; | ||
| public final T3 v3; | ||
| public final T4 v4; | ||
| public final T5 v5; | ||
| public final T6 v6; | ||
| public final T7 v7; | ||
| public final T8 v8; | ||
| public final T9 v9; | ||
|
|
||
| public T1 v1() { | ||
| return v1; | ||
| } | ||
|
|
||
| public T2 v2() { | ||
| return v2; | ||
| } | ||
|
|
||
| public T3 v3() { | ||
| return v3; | ||
| } | ||
|
|
||
| public T4 v4() { | ||
| return v4; | ||
| } | ||
|
|
||
| public T5 v5() { | ||
| return v5; | ||
| } | ||
|
|
||
| public T6 v6() { | ||
| return v6; | ||
| } | ||
|
|
||
| public T7 v7() { | ||
| return v7; | ||
| } | ||
|
|
||
| public T8 v8() { | ||
| return v8; | ||
| } | ||
|
|
||
| public T9 v9() { | ||
| return v9; | ||
| } | ||
|
|
||
| public Tuple9(Tuple9<T1, T2, T3, T4, T5, T6, T7, T8, T9> tuple) { | ||
| this.v1 = tuple.v1; | ||
| this.v2 = tuple.v2; | ||
| this.v3 = tuple.v3; | ||
| this.v4 = tuple.v4; | ||
| this.v5 = tuple.v5; | ||
| this.v6 = tuple.v6; | ||
| this.v7 = tuple.v7; | ||
| this.v8 = tuple.v8; | ||
| this.v9 = tuple.v9; | ||
| } | ||
|
|
||
| public Tuple9(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9) { | ||
| this.v1 = v1; | ||
| this.v2 = v2; | ||
| this.v3 = v3; | ||
| this.v4 = v4; | ||
| this.v5 = v5; | ||
| this.v6 = v6; | ||
| this.v7 = v7; | ||
| this.v8 = v8; | ||
| this.v9 = v9; | ||
| } | ||
|
|
||
| /** | ||
| * Concatenate a value to this tuple. | ||
| */ | ||
| public final <T10> Tuple10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> concat(T10 value) { | ||
| return new Tuple10<>(v1, v2, v3, v4, v5, v6, v7, v8, v9, value); | ||
| } | ||
|
|
||
| /** | ||
| * Concatenate a tuple to this tuple. | ||
| */ | ||
| public final <T10> Tuple10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> concat(Tuple1<T10> tuple) { | ||
| return new Tuple10<>(v1, v2, v3, v4, v5, v6, v7, v8, v9, tuple.v1); | ||
| } | ||
|
|
||
| /** | ||
| * Concatenate a tuple to this tuple. | ||
| */ | ||
| public final <T10, T11> Tuple11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> concat(Tuple2<T10, T11> tuple) { | ||
| return new Tuple11<>(v1, v2, v3, v4, v5, v6, v7, v8, v9, tuple.v1, tuple.v2); | ||
| } | ||
|
|
||
| /** | ||
| * Concatenate a tuple to this tuple. | ||
| */ | ||
| public final <T10, T11, T12> Tuple12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> concat(Tuple3<T10, T11, T12> tuple) { | ||
| return new Tuple12<>(v1, v2, v3, v4, v5, v6, v7, v8, v9, tuple.v1, tuple.v2, tuple.v3); | ||
| } | ||
|
|
||
| /** | ||
| * Concatenate a tuple to this tuple. | ||
| */ | ||
| public final <T10, T11, T12, T13> Tuple13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> concat(Tuple4<T10, T11, T12, T13> tuple) { | ||
| return new Tuple13<>(v1, v2, v3, v4, v5, v6, v7, v8, v9, tuple.v1, tuple.v2, tuple.v3, tuple.v4); | ||
| } | ||
|
|
||
| /** | ||
| * Concatenate a tuple to this tuple. | ||
| */ | ||
| public final <T10, T11, T12, T13, T14> Tuple14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> concat(Tuple5<T10, T11, T12, T13, T14> tuple) { | ||
| return new Tuple14<>(v1, v2, v3, v4, v5, v6, v7, v8, v9, tuple.v1, tuple.v2, tuple.v3, tuple.v4, tuple.v5); | ||
| } | ||
|
|
||
| /** | ||
| * Concatenate a tuple to this tuple. | ||
| */ | ||
| public final <T10, T11, T12, T13, T14, T15> Tuple15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> concat(Tuple6<T10, T11, T12, T13, T14, T15> tuple) { | ||
| return new Tuple15<>(v1, v2, v3, v4, v5, v6, v7, v8, v9, tuple.v1, tuple.v2, tuple.v3, tuple.v4, tuple.v5, tuple.v6); | ||
| } | ||
|
|
||
| /** | ||
| * Concatenate a tuple to this tuple. | ||
| */ | ||
| public final <T10, T11, T12, T13, T14, T15, T16> Tuple16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> concat(Tuple7<T10, T11, T12, T13, T14, T15, T16> tuple) { | ||
| return new Tuple16<>(v1, v2, v3, v4, v5, v6, v7, v8, v9, tuple.v1, tuple.v2, tuple.v3, tuple.v4, tuple.v5, tuple.v6, tuple.v7); | ||
| } | ||
|
|
||
| /** | ||
| * Apply this tuple as arguments to a function. | ||
| */ | ||
| public final <R> R map(Function9<T1, T2, T3, T4, T5, T6, T7, T8, T9, R> function) { | ||
| return function.apply(this); | ||
| } | ||
|
|
||
| /** | ||
| * Apply attribute 1 as argument to a function and return a new tuple with the substituted argument. | ||
| */ | ||
| public final <U1> Tuple9<U1, T2, T3, T4, T5, T6, T7, T8, T9> map1(Function1<? super T1, ? extends U1> function) { | ||
| return Tuple.tuple(function.apply(v1), v2, v3, v4, v5, v6, v7, v8, v9); | ||
| } | ||
|
|
||
| /** | ||
| * Apply attribute 2 as argument to a function and return a new tuple with the substituted argument. | ||
| */ | ||
| public final <U2> Tuple9<T1, U2, T3, T4, T5, T6, T7, T8, T9> map2(Function1<? super T2, ? extends U2> function) { | ||
| return Tuple.tuple(v1, function.apply(v2), v3, v4, v5, v6, v7, v8, v9); | ||
| } | ||
|
|
||
| /** | ||
| * Apply attribute 3 as argument to a function and return a new tuple with the substituted argument. | ||
| */ | ||
| public final <U3> Tuple9<T1, T2, U3, T4, T5, T6, T7, T8, T9> map3(Function1<? super T3, ? extends U3> function) { | ||
| return Tuple.tuple(v1, v2, function.apply(v3), v4, v5, v6, v7, v8, v9); | ||
| } | ||
|
|
||
| /** | ||
| * Apply attribute 4 as argument to a function and return a new tuple with the substituted argument. | ||
| */ | ||
| public final <U4> Tuple9<T1, T2, T3, U4, T5, T6, T7, T8, T9> map4(Function1<? super T4, ? extends U4> function) { | ||
| return Tuple.tuple(v1, v2, v3, function.apply(v4), v5, v6, v7, v8, v9); | ||
| } | ||
|
|
||
| /** | ||
| * Apply attribute 5 as argument to a function and return a new tuple with the substituted argument. | ||
| */ | ||
| public final <U5> Tuple9<T1, T2, T3, T4, U5, T6, T7, T8, T9> map5(Function1<? super T5, ? extends U5> function) { | ||
| return Tuple.tuple(v1, v2, v3, v4, function.apply(v5), v6, v7, v8, v9); | ||
| } | ||
|
|
||
| /** | ||
| * Apply attribute 6 as argument to a function and return a new tuple with the substituted argument. | ||
| */ | ||
| public final <U6> Tuple9<T1, T2, T3, T4, T5, U6, T7, T8, T9> map6(Function1<? super T6, ? extends U6> function) { | ||
| return Tuple.tuple(v1, v2, v3, v4, v5, function.apply(v6), v7, v8, v9); | ||
| } | ||
|
|
||
| /** | ||
| * Apply attribute 7 as argument to a function and return a new tuple with the substituted argument. | ||
| */ | ||
| public final <U7> Tuple9<T1, T2, T3, T4, T5, T6, U7, T8, T9> map7(Function1<? super T7, ? extends U7> function) { | ||
| return Tuple.tuple(v1, v2, v3, v4, v5, v6, function.apply(v7), v8, v9); | ||
| } | ||
|
|
||
| /** | ||
| * Apply attribute 8 as argument to a function and return a new tuple with the substituted argument. | ||
| */ | ||
| public final <U8> Tuple9<T1, T2, T3, T4, T5, T6, T7, U8, T9> map8(Function1<? super T8, ? extends U8> function) { | ||
| return Tuple.tuple(v1, v2, v3, v4, v5, v6, v7, function.apply(v8), v9); | ||
| } | ||
|
|
||
| /** | ||
| * Apply attribute 9 as argument to a function and return a new tuple with the substituted argument. | ||
| */ | ||
| public final <U9> Tuple9<T1, T2, T3, T4, T5, T6, T7, T8, U9> map9(Function1<? super T9, ? extends U9> function) { | ||
| return Tuple.tuple(v1, v2, v3, v4, v5, v6, v7, v8, function.apply(v9)); | ||
| } | ||
|
|
||
| @Override | ||
| public final Object[] array() { | ||
| return new Object[] { v1, v2, v3, v4, v5, v6, v7, v8, v9 }; | ||
| } | ||
|
|
||
| @Override | ||
| public final List<?> list() { | ||
| return Arrays.asList(array()); | ||
| } | ||
|
|
||
| /** | ||
| * The degree of this tuple: 9. | ||
| */ | ||
| @Override | ||
| public final int degree() { | ||
| return 9; | ||
| } | ||
|
|
||
| @Override | ||
| @SuppressWarnings("unchecked") | ||
| public final Iterator<Object> iterator() { | ||
| return (Iterator<Object>) list().iterator(); | ||
| } | ||
|
|
||
| @Override | ||
| public int compareTo(Tuple9<T1, T2, T3, T4, T5, T6, T7, T8, T9> other) { | ||
| int result = 0; | ||
|
|
||
| result = Tuples.compare(v1, other.v1); if (result != 0) return result; | ||
| result = Tuples.compare(v2, other.v2); if (result != 0) return result; | ||
| result = Tuples.compare(v3, other.v3); if (result != 0) return result; | ||
| result = Tuples.compare(v4, other.v4); if (result != 0) return result; | ||
| result = Tuples.compare(v5, other.v5); if (result != 0) return result; | ||
| result = Tuples.compare(v6, other.v6); if (result != 0) return result; | ||
| result = Tuples.compare(v7, other.v7); if (result != 0) return result; | ||
| result = Tuples.compare(v8, other.v8); if (result != 0) return result; | ||
| result = Tuples.compare(v9, other.v9); if (result != 0) return result; | ||
|
|
||
| return result; | ||
| } | ||
|
|
||
| @Override | ||
| public boolean equals(Object o) { | ||
| if (this == o) | ||
| return true; | ||
| if (!(o instanceof Tuple9)) | ||
| return false; | ||
|
|
||
| @SuppressWarnings({ "unchecked", "rawtypes" }) | ||
| final Tuple9<T1, T2, T3, T4, T5, T6, T7, T8, T9> that = (Tuple9) o; | ||
|
|
||
| if (!Objects.equals(v1, that.v1)) return false; | ||
| if (!Objects.equals(v2, that.v2)) return false; | ||
| if (!Objects.equals(v3, that.v3)) return false; | ||
| if (!Objects.equals(v4, that.v4)) return false; | ||
| if (!Objects.equals(v5, that.v5)) return false; | ||
| if (!Objects.equals(v6, that.v6)) return false; | ||
| if (!Objects.equals(v7, that.v7)) return false; | ||
| if (!Objects.equals(v8, that.v8)) return false; | ||
| if (!Objects.equals(v9, that.v9)) return false; | ||
|
|
||
| return true; | ||
| } | ||
|
|
||
| @Override | ||
| public int hashCode() { | ||
| final int prime = 31; | ||
| int result = 1; | ||
|
|
||
| result = prime * result + ((v1 == null) ? 0 : v1.hashCode()); | ||
| result = prime * result + ((v2 == null) ? 0 : v2.hashCode()); | ||
| result = prime * result + ((v3 == null) ? 0 : v3.hashCode()); | ||
| result = prime * result + ((v4 == null) ? 0 : v4.hashCode()); | ||
| result = prime * result + ((v5 == null) ? 0 : v5.hashCode()); | ||
| result = prime * result + ((v6 == null) ? 0 : v6.hashCode()); | ||
| result = prime * result + ((v7 == null) ? 0 : v7.hashCode()); | ||
| result = prime * result + ((v8 == null) ? 0 : v8.hashCode()); | ||
| result = prime * result + ((v9 == null) ? 0 : v9.hashCode()); | ||
|
|
||
| return result; | ||
| } | ||
|
|
||
| @Override | ||
| public String toString() { | ||
| return "(" | ||
| + v1 | ||
| + ", " + v2 | ||
| + ", " + v3 | ||
| + ", " + v4 | ||
| + ", " + v5 | ||
| + ", " + v6 | ||
| + ", " + v7 | ||
| + ", " + v8 | ||
| + ", " + v9 | ||
| + ")"; | ||
| } | ||
|
|
||
| @Override | ||
| public Tuple9<T1, T2, T3, T4, T5, T6, T7, T8, T9> clone() { | ||
| return new Tuple9<>(this); | ||
| } | ||
| } |