diff --git a/pom.xml b/pom.xml index e683fd4..1f8dcee 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 fi.solita.utils functional-utils - 0.12.50 + 0.12.52 diff --git a/src/main/java/fi/solita/utils/functional/FunctionalA.java b/src/main/java/fi/solita/utils/functional/FunctionalA.java index ba9c1fe..820c7f3 100644 --- a/src/main/java/fi/solita/utils/functional/FunctionalA.java +++ b/src/main/java/fi/solita/utils/functional/FunctionalA.java @@ -465,6 +465,42 @@ public static final Iterable concat(T[] a, T[] b, T[] c, T[] d, T[] e) { public static final Iterable 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 Iterable 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 Iterable 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 Iterable 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 Iterable 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 Iterable 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 @@ -497,10 +533,45 @@ public static final Iterable concat(Iterable x1, Iterable Iterable concat(Iterable x1, Iterable x2, Iterable x3, Iterable x4, Iterable x5, Iterable x6, Iterable... xs) { - Iterable> a = FunctionalImpl.filter(Predicates.not(Predicates.isNull()), newList(x1, x2, x3, x4, x5, x6)); + public static final Iterable concat(Iterable x1, Iterable x2, Iterable x3, Iterable x4, Iterable x5, Iterable x6, Iterable x7) { + return x1 == null && x2 == null && x3 == null && x4 == null && x5 == null && x6 == null && x7 == null ? null : new ConcatenatingIterable(FunctionalImpl.filter(Predicates.not(Predicates.isNull()), newList(x1, x2, x3, x4, x5, x6, x7))); + } + + /** + * @see Functional#concat + */ + public static final Iterable concat(Iterable x1, Iterable x2, Iterable x3, Iterable x4, Iterable x5, Iterable x6, Iterable x7, Iterable x8) { + return x1 == null && x2 == null && x3 == null && x4 == null && x5 == null && x6 == null && x7 == null && x8 == null ? null : new ConcatenatingIterable(FunctionalImpl.filter(Predicates.not(Predicates.isNull()), newList(x1, x2, x3, x4, x5, x6, x7, x8))); + } + + /** + * @see Functional#concat + */ + public static final Iterable concat(Iterable x1, Iterable x2, Iterable x3, Iterable x4, Iterable x5, Iterable x6, Iterable x7, Iterable x8, Iterable x9) { + return x1 == null && x2 == null && x3 == null && x4 == null && x5 == null && x6 == null && x7 == null && x8 == null && x9 == null ? null : new ConcatenatingIterable(FunctionalImpl.filter(Predicates.not(Predicates.isNull()), newList(x1, x2, x3, x4, x5, x6, x7, x8, x9))); + } + + /** + * @see Functional#concat + */ + public static final Iterable concat(Iterable x1, Iterable x2, Iterable x3, Iterable x4, Iterable x5, Iterable x6, Iterable x7, Iterable x8, Iterable x9, Iterable 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(FunctionalImpl.filter(Predicates.not(Predicates.isNull()), newList(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10))); + } + + /** + * @see Functional#concat + */ + public static final Iterable concat(Iterable x1, Iterable x2, Iterable x3, Iterable x4, Iterable x5, Iterable x6, Iterable x7, Iterable x8, Iterable x9, Iterable x10, Iterable 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(FunctionalImpl.filter(Predicates.not(Predicates.isNull()), newList(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11))); + } + + /** + * @see Functional#concat + */ + public static final Iterable concat(Iterable x1, Iterable x2, Iterable x3, Iterable x4, Iterable x5, Iterable x6, Iterable x7, Iterable x8, Iterable x9, Iterable x10, Iterable x11, Iterable... xs) { + Iterable> a = FunctionalImpl.filter(Predicates.not(Predicates.isNull()), newList(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11)); Iterable> 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(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(FunctionalImpl.concat(a, b)); } @@ -889,8 +960,15 @@ public static final ApplyBi combineEndo(final Apply ApplyBi combineEndo(final Apply> f1, final Apply> f2, final Apply> f3, final Apply> f4, final Apply> f5, final Apply>... fs) { - return FunctionalImpl.combineEndo(concat(newList(f1, f2, f3, f4, f5), fs)); + public static final ApplyBi combineEndo(final Apply> f1, final Apply> f2, final Apply> f3, final Apply> f4, final Apply> f5) { + return FunctionalImpl.combineEndo(newList(f1, f2, f3, f4, f5)); + } + + /** + * @see Functional#combineEndo + */ + public static final ApplyBi combineEndo(final Apply> f1, final Apply> f2, final Apply> f3, final Apply> f4, final Apply> f5, final Apply> f6, final Apply>... fs) { + return FunctionalImpl.combineEndo(concat(newList(f1, f2, f3, f4, f5, f6), fs)); }