Skip to content

Commit 31cd4e3

Browse files
committed
Add concat() methods
1 parent 0ee114f commit 31cd4e3

40 files changed

+1409
-3362
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1-
.idea
21
target
2+
.classpath
3+
.project
4+
.settings
5+
.idea

pom.xml

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<modelVersion>4.0.0</modelVersion>
66
<groupId>com.andrebreves</groupId>
77
<artifactId>java-tuple</artifactId>
8-
<version>1.1.0</version>
8+
<version>1.2.0</version>
99
<packaging>jar</packaging>
1010

1111
<name>${project.groupId}:${project.artifactId}</name>
@@ -64,7 +64,7 @@
6464
<plugin>
6565
<groupId>org.apache.maven.plugins</groupId>
6666
<artifactId>maven-compiler-plugin</artifactId>
67-
<version>3.8.0</version>
67+
<version>3.8.1</version>
6868
<executions>
6969
<execution>
7070
<id>compile-tuple-generator</id>
@@ -115,6 +115,27 @@
115115
</executions>
116116
</plugin>
117117

118+
<!-- Code Coverage -->
119+
<plugin>
120+
<groupId>org.jacoco</groupId>
121+
<artifactId>jacoco-maven-plugin</artifactId>
122+
<version>0.8.4</version>
123+
<executions>
124+
<execution>
125+
<goals>
126+
<goal>prepare-agent</goal>
127+
</goals>
128+
</execution>
129+
<execution>
130+
<id>report</id>
131+
<phase>prepare-package</phase>
132+
<goals>
133+
<goal>report</goal>
134+
</goals>
135+
</execution>
136+
</executions>
137+
</plugin>
138+
118139
<!-- Include generated sources to the clean goal -->
119140
<plugin>
120141
<artifactId>maven-clean-plugin</artifactId>
@@ -141,7 +162,7 @@
141162
<plugin>
142163
<groupId>org.apache.maven.plugins</groupId>
143164
<artifactId>maven-source-plugin</artifactId>
144-
<version>3.0.1</version>
165+
<version>3.1.0</version>
145166
<executions>
146167
<execution>
147168
<id>attach-sources</id>
@@ -156,7 +177,7 @@
156177
<plugin>
157178
<groupId>org.apache.maven.plugins</groupId>
158179
<artifactId>maven-javadoc-plugin</artifactId>
159-
<version>3.0.1</version>
180+
<version>3.1.1</version>
160181
<configuration>
161182
<additionalJOption>-Xdoclint:none</additionalJOption>
162183
</configuration>
@@ -190,7 +211,7 @@
190211
<plugin>
191212
<groupId>org.sonatype.plugins</groupId>
192213
<artifactId>nexus-staging-maven-plugin</artifactId>
193-
<version>1.6.7</version>
214+
<version>1.6.8</version>
194215
<extensions>true</extensions>
195216
<configuration>
196217
<serverId>ossrh</serverId>

src/main/java/com/andrebreves/tuple/Tuple0.java

Lines changed: 156 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,165 @@ private Tuple0() {
2323
}
2424

2525
/** Returns a Tuple that has no values. */
26-
public static Tuple0 of() {
26+
public static Tuple0 of() {
2727
return new Tuple0();
2828
}
2929

30+
/** Returns a Tuple containing the values of this Tuple and the values passed as parameters. */
31+
public Tuple0 concat() {
32+
return this;
33+
}
34+
35+
/** Returns a Tuple containing the values of this Tuple and the values passed as parameters. */
36+
public <T1> Tuple1<T1> concat(T1 v1) {
37+
return Tuple1.of(v1);
38+
}
39+
40+
/** Returns a Tuple containing the values of this Tuple and the values passed as parameters. */
41+
public <T1, T2> Tuple2<T1, T2> concat(T1 v1, T2 v2) {
42+
return Tuple2.of(v1, v2);
43+
}
44+
45+
/** Returns a Tuple containing the values of this Tuple and the values passed as parameters. */
46+
public <T1, T2, T3> Tuple3<T1, T2, T3> concat(T1 v1, T2 v2, T3 v3) {
47+
return Tuple3.of(v1, v2, v3);
48+
}
49+
50+
/** Returns a Tuple containing the values of this Tuple and the values passed as parameters. */
51+
public <T1, T2, T3, T4> Tuple4<T1, T2, T3, T4> concat(T1 v1, T2 v2, T3 v3, T4 v4) {
52+
return Tuple4.of(v1, v2, v3, v4);
53+
}
54+
55+
/** Returns a Tuple containing the values of this Tuple and the values passed as parameters. */
56+
public <T1, T2, T3, T4, T5> Tuple5<T1, T2, T3, T4, T5> concat(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5) {
57+
return Tuple5.of(v1, v2, v3, v4, v5);
58+
}
59+
60+
/** Returns a Tuple containing the values of this Tuple and the values passed as parameters. */
61+
public <T1, T2, T3, T4, T5, T6> Tuple6<T1, T2, T3, T4, T5, T6> concat(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6) {
62+
return Tuple6.of(v1, v2, v3, v4, v5, v6);
63+
}
64+
65+
/** Returns a Tuple containing the values of this Tuple and the values passed as parameters. */
66+
public <T1, T2, T3, T4, T5, T6, T7> Tuple7<T1, T2, T3, T4, T5, T6, T7> concat(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7) {
67+
return Tuple7.of(v1, v2, v3, v4, v5, v6, v7);
68+
}
69+
70+
/** Returns a Tuple containing the values of this Tuple and the values passed as parameters. */
71+
public <T1, T2, T3, T4, T5, T6, T7, T8> Tuple8<T1, T2, T3, T4, T5, T6, T7, T8> concat(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8) {
72+
return Tuple8.of(v1, v2, v3, v4, v5, v6, v7, v8);
73+
}
74+
75+
/** Returns a Tuple containing the values of this Tuple and the values passed as parameters. */
76+
public <T1, T2, T3, T4, T5, T6, T7, T8, T9> Tuple9<T1, T2, T3, T4, T5, T6, T7, T8, T9> concat(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9) {
77+
return Tuple9.of(v1, v2, v3, v4, v5, v6, v7, v8, v9);
78+
}
79+
80+
/** Returns a Tuple containing the values of this Tuple and the values passed as parameters. */
81+
public <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> Tuple10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> concat(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10) {
82+
return Tuple10.of(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10);
83+
}
84+
85+
/** Returns a Tuple containing the values of this Tuple and the values passed as parameters. */
86+
public <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Tuple11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> concat(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11) {
87+
return Tuple11.of(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11);
88+
}
89+
90+
/** Returns a Tuple containing the values of this Tuple and the values passed as parameters. */
91+
public <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Tuple12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> concat(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12) {
92+
return Tuple12.of(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12);
93+
}
94+
95+
/** Returns a Tuple containing the values of this Tuple and the values passed as parameters. */
96+
public <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Tuple13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> concat(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) {
97+
return Tuple13.of(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13);
98+
}
99+
100+
/** Returns a Tuple containing the values of this Tuple and the values passed as parameters. */
101+
public <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> Tuple14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> concat(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) {
102+
return Tuple14.of(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14);
103+
}
104+
105+
/** Returns a Tuple containing the values of this Tuple and the values passed as parameters. */
106+
public <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> Tuple15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> concat(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) {
107+
return Tuple15.of(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15);
108+
}
109+
110+
/** Returns a Tuple containing the values of this Tuple and the values of the Tuple passed as parameter. */
111+
public <T1> Tuple1<T1> concat(Tuple1<T1> t) {
112+
return Tuple1.of(t.v1());
113+
}
114+
115+
/** Returns a Tuple containing the values of this Tuple and the values of the Tuple passed as parameter. */
116+
public <T1, T2> Tuple2<T1, T2> concat(Tuple2<T1, T2> t) {
117+
return Tuple2.of(t.v1(), t.v2());
118+
}
119+
120+
/** Returns a Tuple containing the values of this Tuple and the values of the Tuple passed as parameter. */
121+
public <T1, T2, T3> Tuple3<T1, T2, T3> concat(Tuple3<T1, T2, T3> t) {
122+
return Tuple3.of(t.v1(), t.v2(), t.v3());
123+
}
124+
125+
/** Returns a Tuple containing the values of this Tuple and the values of the Tuple passed as parameter. */
126+
public <T1, T2, T3, T4> Tuple4<T1, T2, T3, T4> concat(Tuple4<T1, T2, T3, T4> t) {
127+
return Tuple4.of(t.v1(), t.v2(), t.v3(), t.v4());
128+
}
129+
130+
/** Returns a Tuple containing the values of this Tuple and the values of the Tuple passed as parameter. */
131+
public <T1, T2, T3, T4, T5> Tuple5<T1, T2, T3, T4, T5> concat(Tuple5<T1, T2, T3, T4, T5> t) {
132+
return Tuple5.of(t.v1(), t.v2(), t.v3(), t.v4(), t.v5());
133+
}
134+
135+
/** Returns a Tuple containing the values of this Tuple and the values of the Tuple passed as parameter. */
136+
public <T1, T2, T3, T4, T5, T6> Tuple6<T1, T2, T3, T4, T5, T6> concat(Tuple6<T1, T2, T3, T4, T5, T6> t) {
137+
return Tuple6.of(t.v1(), t.v2(), t.v3(), t.v4(), t.v5(), t.v6());
138+
}
139+
140+
/** Returns a Tuple containing the values of this Tuple and the values of the Tuple passed as parameter. */
141+
public <T1, T2, T3, T4, T5, T6, T7> Tuple7<T1, T2, T3, T4, T5, T6, T7> concat(Tuple7<T1, T2, T3, T4, T5, T6, T7> t) {
142+
return Tuple7.of(t.v1(), t.v2(), t.v3(), t.v4(), t.v5(), t.v6(), t.v7());
143+
}
144+
145+
/** Returns a Tuple containing the values of this Tuple and the values of the Tuple passed as parameter. */
146+
public <T1, T2, T3, T4, T5, T6, T7, T8> Tuple8<T1, T2, T3, T4, T5, T6, T7, T8> concat(Tuple8<T1, T2, T3, T4, T5, T6, T7, T8> t) {
147+
return Tuple8.of(t.v1(), t.v2(), t.v3(), t.v4(), t.v5(), t.v6(), t.v7(), t.v8());
148+
}
149+
150+
/** Returns a Tuple containing the values of this Tuple and the values of the Tuple passed as parameter. */
151+
public <T1, T2, T3, T4, T5, T6, T7, T8, T9> Tuple9<T1, T2, T3, T4, T5, T6, T7, T8, T9> concat(Tuple9<T1, T2, T3, T4, T5, T6, T7, T8, T9> t) {
152+
return Tuple9.of(t.v1(), t.v2(), t.v3(), t.v4(), t.v5(), t.v6(), t.v7(), t.v8(), t.v9());
153+
}
154+
155+
/** Returns a Tuple containing the values of this Tuple and the values of the Tuple passed as parameter. */
156+
public <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> Tuple10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> concat(Tuple10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> t) {
157+
return Tuple10.of(t.v1(), t.v2(), t.v3(), t.v4(), t.v5(), t.v6(), t.v7(), t.v8(), t.v9(), t.v10());
158+
}
159+
160+
/** Returns a Tuple containing the values of this Tuple and the values of the Tuple passed as parameter. */
161+
public <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Tuple11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> concat(Tuple11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> t) {
162+
return Tuple11.of(t.v1(), t.v2(), t.v3(), t.v4(), t.v5(), t.v6(), t.v7(), t.v8(), t.v9(), t.v10(), t.v11());
163+
}
164+
165+
/** Returns a Tuple containing the values of this Tuple and the values of the Tuple passed as parameter. */
166+
public <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Tuple12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> concat(Tuple12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> t) {
167+
return Tuple12.of(t.v1(), t.v2(), t.v3(), t.v4(), t.v5(), t.v6(), t.v7(), t.v8(), t.v9(), t.v10(), t.v11(), t.v12());
168+
}
169+
170+
/** Returns a Tuple containing the values of this Tuple and the values of the Tuple passed as parameter. */
171+
public <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Tuple13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> concat(Tuple13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> t) {
172+
return Tuple13.of(t.v1(), t.v2(), t.v3(), t.v4(), t.v5(), t.v6(), t.v7(), t.v8(), t.v9(), t.v10(), t.v11(), t.v12(), t.v13());
173+
}
174+
175+
/** Returns a Tuple containing the values of this Tuple and the values of the Tuple passed as parameter. */
176+
public <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> Tuple14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> concat(Tuple14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> t) {
177+
return Tuple14.of(t.v1(), t.v2(), t.v3(), t.v4(), t.v5(), t.v6(), t.v7(), t.v8(), t.v9(), t.v10(), t.v11(), t.v12(), t.v13(), t.v14());
178+
}
179+
180+
/** Returns a Tuple containing the values of this Tuple and the values of the Tuple passed as parameter. */
181+
public <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> Tuple15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> concat(Tuple15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> t) {
182+
return Tuple15.of(t.v1(), t.v2(), t.v3(), t.v4(), t.v5(), t.v6(), t.v7(), t.v8(), t.v9(), t.v10(), t.v11(), t.v12(), t.v13(), t.v14(), t.v15());
183+
}
184+
30185
@Override
31186
public int degree() { return 0; }
32187

0 commit comments

Comments
 (0)