Skip to content

Commit

Permalink
some more overloads
Browse files Browse the repository at this point in the history
  • Loading branch information
jyrimatti committed Jun 28, 2024
1 parent 1aa400c commit 532efb2
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>fi.solita.utils</groupId>
<artifactId>functional-utils</artifactId>
<version>0.12.50</version>
<version>0.12.52</version>
<build>
<resources>
<resource>
Expand Down
88 changes: 83 additions & 5 deletions src/main/java/fi/solita/utils/functional/FunctionalA.java
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,42 @@ public static final <T> Iterable<T> concat(T[] a, T[] b, T[] c, T[] d, T[] e) {
public static final <T> Iterable<T> concat(T[] a, T[] b, T[] c, T[] d, T[] e, T[] f) {
return concat(newList(a), newList(b), newList(c), newList(d), newList(e), newList(f));
}


/**
* @see Functional#concat
*/
public static final <T> Iterable<T> concat(T[] a, T[] b, T[] c, T[] d, T[] e, T[] f, T[] g) {
return concat(newList(a), newList(b), newList(c), newList(d), newList(e), newList(f), newList(g));
}

/**
* @see Functional#concat
*/
public static final <T> Iterable<T> concat(T[] a, T[] b, T[] c, T[] d, T[] e, T[] f, T[] g, T[] h) {
return concat(newList(a), newList(b), newList(c), newList(d), newList(e), newList(f), newList(g), newList(h));
}

/**
* @see Functional#concat
*/
public static final <T> Iterable<T> concat(T[] a, T[] b, T[] c, T[] d, T[] e, T[] f, T[] g, T[] h, T[] i) {
return concat(newList(a), newList(b), newList(c), newList(d), newList(e), newList(f), newList(g), newList(h), newList(i));
}

/**
* @see Functional#concat
*/
public static final <T> Iterable<T> concat(T[] a, T[] b, T[] c, T[] d, T[] e, T[] f, T[] g, T[] h, T[] i, T[] j) {
return concat(newList(a), newList(b), newList(c), newList(d), newList(e), newList(f), newList(g), newList(h), newList(i), newList(j));
}

/**
* @see Functional#concat
*/
public static final <T> Iterable<T> concat(T[] a, T[] b, T[] c, T[] d, T[] e, T[] f, T[] g, T[] h, T[] i, T[] j, T[] k) {
return concat(newList(a), newList(b), newList(c), newList(d), newList(e), newList(f), newList(g), newList(h), newList(i), newList(j), newList(k));
}

/**
* @see Functional#concat
Expand Down Expand Up @@ -497,10 +533,45 @@ public static final <T> Iterable<T> concat(Iterable<? extends T> x1, Iterable<?
/**
* @see Functional#concat
*/
public static final <T> Iterable<T> concat(Iterable<? extends T> x1, Iterable<? extends T> x2, Iterable<? extends T> x3, Iterable<? extends T> x4, Iterable<? extends T> x5, Iterable<? extends T> x6, Iterable<? extends T>... xs) {
Iterable<Iterable<? extends T>> a = FunctionalImpl.filter(Predicates.not(Predicates.isNull()), newList(x1, x2, x3, x4, x5, x6));
public static final <T> Iterable<T> concat(Iterable<? extends T> x1, Iterable<? extends T> x2, Iterable<? extends T> x3, Iterable<? extends T> x4, Iterable<? extends T> x5, Iterable<? extends T> x6, Iterable<? extends T> x7) {
return x1 == null && x2 == null && x3 == null && x4 == null && x5 == null && x6 == null && x7 == null ? null : new ConcatenatingIterable<T>(FunctionalImpl.filter(Predicates.not(Predicates.isNull()), newList(x1, x2, x3, x4, x5, x6, x7)));
}

/**
* @see Functional#concat
*/
public static final <T> Iterable<T> concat(Iterable<? extends T> x1, Iterable<? extends T> x2, Iterable<? extends T> x3, Iterable<? extends T> x4, Iterable<? extends T> x5, Iterable<? extends T> x6, Iterable<? extends T> x7, Iterable<? extends T> x8) {
return x1 == null && x2 == null && x3 == null && x4 == null && x5 == null && x6 == null && x7 == null && x8 == null ? null : new ConcatenatingIterable<T>(FunctionalImpl.filter(Predicates.not(Predicates.isNull()), newList(x1, x2, x3, x4, x5, x6, x7, x8)));
}

/**
* @see Functional#concat
*/
public static final <T> Iterable<T> concat(Iterable<? extends T> x1, Iterable<? extends T> x2, Iterable<? extends T> x3, Iterable<? extends T> x4, Iterable<? extends T> x5, Iterable<? extends T> x6, Iterable<? extends T> x7, Iterable<? extends T> x8, Iterable<? extends T> x9) {
return x1 == null && x2 == null && x3 == null && x4 == null && x5 == null && x6 == null && x7 == null && x8 == null && x9 == null ? null : new ConcatenatingIterable<T>(FunctionalImpl.filter(Predicates.not(Predicates.isNull()), newList(x1, x2, x3, x4, x5, x6, x7, x8, x9)));
}

/**
* @see Functional#concat
*/
public static final <T> Iterable<T> concat(Iterable<? extends T> x1, Iterable<? extends T> x2, Iterable<? extends T> x3, Iterable<? extends T> x4, Iterable<? extends T> x5, Iterable<? extends T> x6, Iterable<? extends T> x7, Iterable<? extends T> x8, Iterable<? extends T> x9, Iterable<? extends T> x10) {
return x1 == null && x2 == null && x3 == null && x4 == null && x5 == null && x6 == null && x7 == null && x8 == null && x9 == null && x10 == null ? null : new ConcatenatingIterable<T>(FunctionalImpl.filter(Predicates.not(Predicates.isNull()), newList(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)));
}

/**
* @see Functional#concat
*/
public static final <T> Iterable<T> concat(Iterable<? extends T> x1, Iterable<? extends T> x2, Iterable<? extends T> x3, Iterable<? extends T> x4, Iterable<? extends T> x5, Iterable<? extends T> x6, Iterable<? extends T> x7, Iterable<? extends T> x8, Iterable<? extends T> x9, Iterable<? extends T> x10, Iterable<? extends T> x11) {
return x1 == null && x2 == null && x3 == null && x4 == null && x5 == null && x6 == null && x7 == null && x8 == null && x9 == null && x10 == null && x11 == null ? null : new ConcatenatingIterable<T>(FunctionalImpl.filter(Predicates.not(Predicates.isNull()), newList(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11)));
}

/**
* @see Functional#concat
*/
public static final <T> Iterable<T> concat(Iterable<? extends T> x1, Iterable<? extends T> x2, Iterable<? extends T> x3, Iterable<? extends T> x4, Iterable<? extends T> x5, Iterable<? extends T> x6, Iterable<? extends T> x7, Iterable<? extends T> x8, Iterable<? extends T> x9, Iterable<? extends T> x10, Iterable<? extends T> x11, Iterable<? extends T>... xs) {
Iterable<Iterable<? extends T>> a = FunctionalImpl.filter(Predicates.not(Predicates.isNull()), newList(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11));
Iterable<Iterable<? extends T>> b = filter(Predicates.not(Predicates.isNull()), xs);
return x1 == null && x2 == null && x3 == null && x4 == null && x5 == null && x6 == null && xs == null ? null : new ConcatenatingIterable<T>(FunctionalImpl.concat(a, b));
return x1 == null && x2 == null && x3 == null && x4 == null && x5 == null && x6 == null && x7 == null && x8 == null && x9 == null && x10 == null && x11 == null && xs == null ? null : new ConcatenatingIterable<T>(FunctionalImpl.concat(a, b));
}


Expand Down Expand Up @@ -889,8 +960,15 @@ public static final <P,T,R> ApplyBi<P,T,T> combineEndo(final Apply<P,? extends A
/**
* @see Functional#combineEndo
*/
public static final <P,T,R> ApplyBi<P,T,T> combineEndo(final Apply<P,? extends Apply<T,T>> f1, final Apply<P,? extends Apply<T,T>> f2, final Apply<P,? extends Apply<T,T>> f3, final Apply<P,? extends Apply<T,T>> f4, final Apply<P,? extends Apply<T,T>> f5, final Apply<P,? extends Apply<T,T>>... fs) {
return FunctionalImpl.combineEndo(concat(newList(f1, f2, f3, f4, f5), fs));
public static final <P,T,R> ApplyBi<P,T,T> combineEndo(final Apply<P,? extends Apply<T,T>> f1, final Apply<P,? extends Apply<T,T>> f2, final Apply<P,? extends Apply<T,T>> f3, final Apply<P,? extends Apply<T,T>> f4, final Apply<P,? extends Apply<T,T>> f5) {
return FunctionalImpl.combineEndo(newList(f1, f2, f3, f4, f5));
}

/**
* @see Functional#combineEndo
*/
public static final <P,T,R> ApplyBi<P,T,T> combineEndo(final Apply<P,? extends Apply<T,T>> f1, final Apply<P,? extends Apply<T,T>> f2, final Apply<P,? extends Apply<T,T>> f3, final Apply<P,? extends Apply<T,T>> f4, final Apply<P,? extends Apply<T,T>> f5, final Apply<P,? extends Apply<T,T>> f6, final Apply<P,? extends Apply<T,T>>... fs) {
return FunctionalImpl.combineEndo(concat(newList(f1, f2, f3, f4, f5, f6), fs));
}


Expand Down

0 comments on commit 532efb2

Please sign in to comment.