[jOOQ/jOOQ#16716] Generate MyTable.let(Function<? super MyTable, ? extends R>) utilities on generated tables
This commit is contained in:
parent
40eda69094
commit
60a9153cb2
@ -191,6 +191,7 @@ abstract class AbstractGenerator implements Generator {
|
||||
boolean generateWhereMethodOverrides = true;
|
||||
boolean generateRenameMethodOverrides = true;
|
||||
boolean generateAsMethodOverrides = true;
|
||||
boolean generateLetMethods = true;
|
||||
|
||||
protected GeneratorStrategyWrapper strategy;
|
||||
protected String targetEncoding = "UTF-8";
|
||||
@ -1536,6 +1537,16 @@ abstract class AbstractGenerator implements Generator {
|
||||
this.generateAsMethodOverrides = asMethodOverrides;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean generateLetMethods() {
|
||||
return generateLetMethods;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setGenerateLetMethods(boolean generateLetMethods) {
|
||||
this.generateLetMethods = generateLetMethods;
|
||||
}
|
||||
|
||||
// ----
|
||||
|
||||
@Override
|
||||
|
||||
@ -973,6 +973,8 @@ public class GenerationTool {
|
||||
generator.setGenerateRenameMethodOverrides(g.getGenerate().isRenameMethodOverrides());
|
||||
if (g.getGenerate().isAsMethodOverrides() != null)
|
||||
generator.setGenerateAsMethodOverrides(g.getGenerate().isAsMethodOverrides());
|
||||
if (g.getGenerate().isLetMethods() != null)
|
||||
generator.setGenerateLetMethods(g.getGenerate().isLetMethods());
|
||||
|
||||
|
||||
if (!isBlank(d.getSchemaVersionProvider()))
|
||||
|
||||
@ -1442,6 +1442,16 @@ public interface Generator {
|
||||
*/
|
||||
void setGenerateRenameMethodOverrides(boolean renameMethodOverrides);
|
||||
|
||||
/**
|
||||
* Whether to generate let methods on {@link Table} types.
|
||||
*/
|
||||
boolean generateLetMethods();
|
||||
|
||||
/**
|
||||
* Whether to generate let methods on {@link Table} types.
|
||||
*/
|
||||
void setGenerateLetMethods(boolean letMethods);
|
||||
|
||||
/**
|
||||
* Whether to generate overrides for {@link Table#as(Name)} and related
|
||||
* overloads.
|
||||
|
||||
@ -39,7 +39,6 @@ package org.jooq.codegen;
|
||||
|
||||
|
||||
import static java.util.Arrays.asList;
|
||||
import static java.util.Collections.nCopies;
|
||||
import static java.util.Collections.singletonList;
|
||||
import static java.util.function.Function.identity;
|
||||
import static java.util.stream.Collectors.counting;
|
||||
@ -85,7 +84,6 @@ import java.util.EnumSet;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.IdentityHashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
@ -116,6 +114,8 @@ import org.jooq.Domain;
|
||||
import org.jooq.EnumType;
|
||||
import org.jooq.Field;
|
||||
import org.jooq.ForeignKey;
|
||||
import org.jooq.Function1;
|
||||
import org.jooq.Functions;
|
||||
import org.jooq.Generated;
|
||||
import org.jooq.Identity;
|
||||
import org.jooq.Index;
|
||||
@ -7708,6 +7708,13 @@ public class JavaGenerator extends AbstractGenerator {
|
||||
out.println("}");
|
||||
}
|
||||
|
||||
if (generateLetMethods()) {
|
||||
out.javadoc("Apply this table to a function, see also {@link %s#let(%s)}", Functions.class, Function1.class);
|
||||
out.println("%s<R> R let(%s<? super %s, ? extends R> function) {", visibilityPublic(), Function.class, className);
|
||||
out.println("return function.apply(this);");
|
||||
out.println("}");
|
||||
}
|
||||
|
||||
if (generateWhereMethodOverrides() && !table.isTableValuedFunction()) {
|
||||
Consumer<Runnable> idt = r -> {
|
||||
out.javadoc("Create an inline derived table from this table");
|
||||
|
||||
@ -270,6 +270,8 @@ public class Generate implements Serializable, XMLAppendable
|
||||
protected Boolean renameMethodOverrides = true;
|
||||
@XmlElement(defaultValue = "true")
|
||||
protected Boolean asMethodOverrides = true;
|
||||
@XmlElement(defaultValue = "true")
|
||||
protected Boolean letMethods = true;
|
||||
@XmlElement(defaultValue = "false")
|
||||
protected Boolean hiddenColumnsInRecords = false;
|
||||
@XmlElement(defaultValue = "false")
|
||||
@ -3071,6 +3073,30 @@ public class Generate implements Serializable, XMLAppendable
|
||||
this.asMethodOverrides = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether to generate <code>let</code> methods on generated {@link org.jooq.Table} types.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link Boolean }
|
||||
*
|
||||
*/
|
||||
public Boolean isLetMethods() {
|
||||
return letMethods;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether to generate <code>let</code> methods on generated {@link org.jooq.Table} types.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link Boolean }
|
||||
*
|
||||
*/
|
||||
public void setLetMethods(Boolean value) {
|
||||
this.letMethods = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether hidden columns should be generated in records.
|
||||
* <p>
|
||||
@ -4247,6 +4273,15 @@ public class Generate implements Serializable, XMLAppendable
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether to generate <code>let</code> methods on generated {@link org.jooq.Table} types.
|
||||
*
|
||||
*/
|
||||
public Generate withLetMethods(Boolean value) {
|
||||
setLetMethods(value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether hidden columns should be generated in records.
|
||||
* <p>
|
||||
@ -4399,6 +4434,7 @@ public class Generate implements Serializable, XMLAppendable
|
||||
builder.append("whereMethodOverrides", whereMethodOverrides);
|
||||
builder.append("renameMethodOverrides", renameMethodOverrides);
|
||||
builder.append("asMethodOverrides", asMethodOverrides);
|
||||
builder.append("letMethods", letMethods);
|
||||
builder.append("hiddenColumnsInRecords", hiddenColumnsInRecords);
|
||||
builder.append("hiddenColumnsInPojos", hiddenColumnsInPojos);
|
||||
builder.append("hiddenColumnsInInterfaces", hiddenColumnsInInterfaces);
|
||||
@ -5476,6 +5512,15 @@ public class Generate implements Serializable, XMLAppendable
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (letMethods == null) {
|
||||
if (other.letMethods!= null) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if (!letMethods.equals(other.letMethods)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (hiddenColumnsInRecords == null) {
|
||||
if (other.hiddenColumnsInRecords!= null) {
|
||||
return false;
|
||||
@ -5627,6 +5672,7 @@ public class Generate implements Serializable, XMLAppendable
|
||||
result = ((prime*result)+((whereMethodOverrides == null)? 0 :whereMethodOverrides.hashCode()));
|
||||
result = ((prime*result)+((renameMethodOverrides == null)? 0 :renameMethodOverrides.hashCode()));
|
||||
result = ((prime*result)+((asMethodOverrides == null)? 0 :asMethodOverrides.hashCode()));
|
||||
result = ((prime*result)+((letMethods == null)? 0 :letMethods.hashCode()));
|
||||
result = ((prime*result)+((hiddenColumnsInRecords == null)? 0 :hiddenColumnsInRecords.hashCode()));
|
||||
result = ((prime*result)+((hiddenColumnsInPojos == null)? 0 :hiddenColumnsInPojos.hashCode()));
|
||||
result = ((prime*result)+((hiddenColumnsInInterfaces == null)? 0 :hiddenColumnsInInterfaces.hashCode()));
|
||||
|
||||
@ -3005,6 +3005,10 @@ This flag is ignored in the commercial Java 6 distribution of jOOQ 3.9+ ]]></jxb
|
||||
<annotation><appinfo><jxb:property><jxb:javadoc><![CDATA[Whether to generate overrides for {@link org.jooq.Table#as(org.jooq.Name)} and related overloads.]]></jxb:javadoc></jxb:property></appinfo></annotation>
|
||||
</element>
|
||||
|
||||
<element name="letMethods" type="boolean" minOccurs="0" maxOccurs="1" default="true">
|
||||
<annotation><appinfo><jxb:property><jxb:javadoc><![CDATA[Whether to generate <code>let</code> methods on generated {@link org.jooq.Table} types.]]></jxb:javadoc></jxb:property></appinfo></annotation>
|
||||
</element>
|
||||
|
||||
<element name="hiddenColumnsInRecords" type="boolean" minOccurs="0" maxOccurs="1" default="false">
|
||||
<annotation><appinfo><jxb:property><jxb:javadoc><![CDATA[Whether hidden columns should be generated in records.
|
||||
<p>
|
||||
|
||||
@ -46,6 +46,182 @@ import org.jetbrains.annotations.NotNull;
|
||||
*/
|
||||
public final class Functions {
|
||||
|
||||
/**
|
||||
* Put a set of 1 arguments in scope of a function.
|
||||
*/
|
||||
@NotNull
|
||||
public static final <T1, R> R let(T1 t1, Function1<? super T1, ? extends R> function) {
|
||||
return function.apply(t1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Put a set of 2 arguments in scope of a function.
|
||||
*/
|
||||
@NotNull
|
||||
public static final <T1, T2, R> R let(T1 t1, T2 t2, Function2<? super T1, ? super T2, ? extends R> function) {
|
||||
return function.apply(t1, t2);
|
||||
}
|
||||
|
||||
/**
|
||||
* Put a set of 3 arguments in scope of a function.
|
||||
*/
|
||||
@NotNull
|
||||
public static final <T1, T2, T3, R> R let(T1 t1, T2 t2, T3 t3, Function3<? super T1, ? super T2, ? super T3, ? extends R> function) {
|
||||
return function.apply(t1, t2, t3);
|
||||
}
|
||||
|
||||
/**
|
||||
* Put a set of 4 arguments in scope of a function.
|
||||
*/
|
||||
@NotNull
|
||||
public static final <T1, T2, T3, T4, R> R let(T1 t1, T2 t2, T3 t3, T4 t4, Function4<? super T1, ? super T2, ? super T3, ? super T4, ? extends R> function) {
|
||||
return function.apply(t1, t2, t3, t4);
|
||||
}
|
||||
|
||||
/**
|
||||
* Put a set of 5 arguments in scope of a function.
|
||||
*/
|
||||
@NotNull
|
||||
public static final <T1, T2, T3, T4, T5, R> R let(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, Function5<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? extends R> function) {
|
||||
return function.apply(t1, t2, t3, t4, t5);
|
||||
}
|
||||
|
||||
/**
|
||||
* Put a set of 6 arguments in scope of a function.
|
||||
*/
|
||||
@NotNull
|
||||
public static final <T1, T2, T3, T4, T5, T6, R> R let(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, Function6<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? extends R> function) {
|
||||
return function.apply(t1, t2, t3, t4, t5, t6);
|
||||
}
|
||||
|
||||
/**
|
||||
* Put a set of 7 arguments in scope of a function.
|
||||
*/
|
||||
@NotNull
|
||||
public static final <T1, T2, T3, T4, T5, T6, T7, R> R let(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, Function7<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? extends R> function) {
|
||||
return function.apply(t1, t2, t3, t4, t5, t6, t7);
|
||||
}
|
||||
|
||||
/**
|
||||
* Put a set of 8 arguments in scope of a function.
|
||||
*/
|
||||
@NotNull
|
||||
public static final <T1, T2, T3, T4, T5, T6, T7, T8, R> R let(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, Function8<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? extends R> function) {
|
||||
return function.apply(t1, t2, t3, t4, t5, t6, t7, t8);
|
||||
}
|
||||
|
||||
/**
|
||||
* Put a set of 9 arguments in scope of a function.
|
||||
*/
|
||||
@NotNull
|
||||
public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, R> R let(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9, Function9<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? extends R> function) {
|
||||
return function.apply(t1, t2, t3, t4, t5, t6, t7, t8, t9);
|
||||
}
|
||||
|
||||
/**
|
||||
* Put a set of 10 arguments in scope of a function.
|
||||
*/
|
||||
@NotNull
|
||||
public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, R> R let(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9, T10 t10, Function10<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? super T10, ? extends R> function) {
|
||||
return function.apply(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10);
|
||||
}
|
||||
|
||||
/**
|
||||
* Put a set of 11 arguments in scope of a function.
|
||||
*/
|
||||
@NotNull
|
||||
public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, R> R let(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9, T10 t10, T11 t11, Function11<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? super T10, ? super T11, ? extends R> function) {
|
||||
return function.apply(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11);
|
||||
}
|
||||
|
||||
/**
|
||||
* Put a set of 12 arguments in scope of a function.
|
||||
*/
|
||||
@NotNull
|
||||
public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, R> R let(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9, T10 t10, T11 t11, T12 t12, Function12<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? super T10, ? super T11, ? super T12, ? extends R> function) {
|
||||
return function.apply(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12);
|
||||
}
|
||||
|
||||
/**
|
||||
* Put a set of 13 arguments in scope of a function.
|
||||
*/
|
||||
@NotNull
|
||||
public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, R> R let(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9, T10 t10, T11 t11, T12 t12, T13 t13, Function13<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? super T10, ? super T11, ? super T12, ? super T13, ? extends R> function) {
|
||||
return function.apply(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13);
|
||||
}
|
||||
|
||||
/**
|
||||
* Put a set of 14 arguments in scope of a function.
|
||||
*/
|
||||
@NotNull
|
||||
public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, R> R let(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9, T10 t10, T11 t11, T12 t12, T13 t13, T14 t14, Function14<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? super T10, ? super T11, ? super T12, ? super T13, ? super T14, ? extends R> function) {
|
||||
return function.apply(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14);
|
||||
}
|
||||
|
||||
/**
|
||||
* Put a set of 15 arguments in scope of a function.
|
||||
*/
|
||||
@NotNull
|
||||
public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, R> R let(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9, T10 t10, T11 t11, T12 t12, T13 t13, T14 t14, T15 t15, Function15<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? super T10, ? super T11, ? super T12, ? super T13, ? super T14, ? super T15, ? extends R> function) {
|
||||
return function.apply(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15);
|
||||
}
|
||||
|
||||
/**
|
||||
* Put a set of 16 arguments in scope of a function.
|
||||
*/
|
||||
@NotNull
|
||||
public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, R> R let(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9, T10 t10, T11 t11, T12 t12, T13 t13, T14 t14, T15 t15, T16 t16, Function16<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? super T10, ? super T11, ? super T12, ? super T13, ? super T14, ? super T15, ? super T16, ? extends R> function) {
|
||||
return function.apply(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16);
|
||||
}
|
||||
|
||||
/**
|
||||
* Put a set of 17 arguments in scope of a function.
|
||||
*/
|
||||
@NotNull
|
||||
public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, R> R let(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9, T10 t10, T11 t11, T12 t12, T13 t13, T14 t14, T15 t15, T16 t16, T17 t17, Function17<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? super T10, ? super T11, ? super T12, ? super T13, ? super T14, ? super T15, ? super T16, ? super T17, ? extends R> function) {
|
||||
return function.apply(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17);
|
||||
}
|
||||
|
||||
/**
|
||||
* Put a set of 18 arguments in scope of a function.
|
||||
*/
|
||||
@NotNull
|
||||
public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, R> R let(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9, T10 t10, T11 t11, T12 t12, T13 t13, T14 t14, T15 t15, T16 t16, T17 t17, T18 t18, Function18<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? super T10, ? super T11, ? super T12, ? super T13, ? super T14, ? super T15, ? super T16, ? super T17, ? super T18, ? extends R> function) {
|
||||
return function.apply(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17, t18);
|
||||
}
|
||||
|
||||
/**
|
||||
* Put a set of 19 arguments in scope of a function.
|
||||
*/
|
||||
@NotNull
|
||||
public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, R> R let(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9, T10 t10, T11 t11, T12 t12, T13 t13, T14 t14, T15 t15, T16 t16, T17 t17, T18 t18, T19 t19, Function19<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? super T10, ? super T11, ? super T12, ? super T13, ? super T14, ? super T15, ? super T16, ? super T17, ? super T18, ? super T19, ? extends R> function) {
|
||||
return function.apply(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17, t18, t19);
|
||||
}
|
||||
|
||||
/**
|
||||
* Put a set of 20 arguments in scope of a function.
|
||||
*/
|
||||
@NotNull
|
||||
public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, R> R let(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9, T10 t10, T11 t11, T12 t12, T13 t13, T14 t14, T15 t15, T16 t16, T17 t17, T18 t18, T19 t19, T20 t20, Function20<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? super T10, ? super T11, ? super T12, ? super T13, ? super T14, ? super T15, ? super T16, ? super T17, ? super T18, ? super T19, ? super T20, ? extends R> function) {
|
||||
return function.apply(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17, t18, t19, t20);
|
||||
}
|
||||
|
||||
/**
|
||||
* Put a set of 21 arguments in scope of a function.
|
||||
*/
|
||||
@NotNull
|
||||
public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, R> R let(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9, T10 t10, T11 t11, T12 t12, T13 t13, T14 t14, T15 t15, T16 t16, T17 t17, T18 t18, T19 t19, T20 t20, T21 t21, Function21<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? super T10, ? super T11, ? super T12, ? super T13, ? super T14, ? super T15, ? super T16, ? super T17, ? super T18, ? super T19, ? super T20, ? super T21, ? extends R> function) {
|
||||
return function.apply(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17, t18, t19, t20, t21);
|
||||
}
|
||||
|
||||
/**
|
||||
* Put a set of 22 arguments in scope of a function.
|
||||
*/
|
||||
@NotNull
|
||||
public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, R> R let(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9, T10 t10, T11 t11, T12 t12, T13 t13, T14 t14, T15 t15, T16 t16, T17 t17, T18 t18, T19 t19, T20 t20, T21 t21, T22 t22, Function22<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? super T10, ? super T11, ? super T12, ? super T13, ? super T14, ? super T15, ? super T16, ? super T17, ? super T18, ? super T19, ? super T20, ? super T21, ? super T22, ? extends R> function) {
|
||||
return function.apply(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17, t18, t19, t20, t21, t22);
|
||||
}
|
||||
|
||||
/**
|
||||
* A function that short circuits the argument function returning <code>null</code>
|
||||
* if all arguments are <code>null</code>.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user