[jOOQ/jOOQ#14186] All UOperator[N] types should extend UOperator, offering an ():List<?>

This commit is contained in:
Lukas Eder 2022-11-08 14:10:00 +01:00
parent a8e90455a0
commit 1e5c0786f4
2 changed files with 89 additions and 6 deletions

View File

@ -2262,6 +2262,5 @@ package org.jooq.impl;

View File

@ -37,6 +37,7 @@
*/
package org.jooq.impl;
import static java.util.Arrays.asList;
import static java.util.Collections.unmodifiableCollection;
import static java.util.Collections.unmodifiableList;
import static java.util.Collections.unmodifiableMap;
@ -46,6 +47,7 @@ import java.math.BigDecimal;
import java.sql.Date;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
@ -4556,6 +4558,7 @@ public final class QOM {
//permits
// XMLConcat
{
@Override
@NotNull default UnmodifiableList<? extends Field<?>> $args() { return $arg1(); }
}
@ -6287,6 +6290,54 @@ public final class QOM {
@ -6675,11 +6726,20 @@ public final class QOM {
// XXX: Utility API
// -------------------------------------------------------------------------
interface UOperator0<R extends org.jooq.QueryPart> extends org.jooq.QueryPart {
interface UOperator<R extends org.jooq.QueryPart> extends org.jooq.QueryPart {
List<?> $args();
}
interface UOperator0<R extends org.jooq.QueryPart> extends UOperator<R> {
@NotNull
Function0<? extends R> $constructor();
@NotNull
@Override
default List<?> $args() {
return Collections.emptyList();
}
@ -6700,7 +6760,7 @@ public final class QOM {
}
interface UOperator1<Q1, R extends org.jooq.QueryPart> extends org.jooq.QueryPart {
interface UOperator1<Q1, R extends org.jooq.QueryPart> extends UOperator<R> {
Q1 $arg1();
@NotNull default R $arg1(Q1 newArg1) { return $constructor().apply(newArg1); }
@ -6708,6 +6768,12 @@ public final class QOM {
@NotNull
Function1<? super Q1, ? extends R> $constructor();
@NotNull
@Override
default List<?> $args() {
return unmodifiableList(asList($arg1()));
}
@ -6729,7 +6795,7 @@ public final class QOM {
}
interface UOperator2<Q1, Q2, R extends org.jooq.QueryPart> extends org.jooq.QueryPart {
interface UOperator2<Q1, Q2, R extends org.jooq.QueryPart> extends UOperator<R> {
Q1 $arg1();
Q2 $arg2();
@ -6738,6 +6804,12 @@ public final class QOM {
@NotNull
Function2<? super Q1, ? super Q2, ? extends R> $constructor();
@NotNull
@Override
default List<?> $args() {
return unmodifiableList(asList($arg1(), $arg2()));
}
@ -6761,7 +6833,7 @@ public final class QOM {
}
interface UOperator3<Q1, Q2, Q3, R extends org.jooq.QueryPart> extends org.jooq.QueryPart {
interface UOperator3<Q1, Q2, Q3, R extends org.jooq.QueryPart> extends UOperator<R> {
Q1 $arg1();
Q2 $arg2();
Q3 $arg3();
@ -6772,6 +6844,12 @@ public final class QOM {
@NotNull
Function3<? super Q1, ? super Q2, ? super Q3, ? extends R> $constructor();
@NotNull
@Override
default List<?> $args() {
return unmodifiableList(asList($arg1(), $arg2(), $arg3()));
}
@ -6795,7 +6873,7 @@ public final class QOM {
}
interface UOperator4<Q1, Q2, Q3, Q4, R extends org.jooq.QueryPart> extends org.jooq.QueryPart {
interface UOperator4<Q1, Q2, Q3, Q4, R extends org.jooq.QueryPart> extends UOperator<R> {
Q1 $arg1();
Q2 $arg2();
Q3 $arg3();
@ -6808,6 +6886,12 @@ public final class QOM {
@NotNull
Function4<? super Q1, ? super Q2, ? super Q3, ? super Q4, ? extends R> $constructor();
@NotNull
@Override
default List<?> $args() {
return unmodifiableList(asList($arg1(), $arg2(), $arg3(), $arg4()));
}