[jOOQ/jOOQ#14537] Add org.jooq.True, org.jooq.False, and org.jooq.Null to QOM API

This commit is contained in:
Lukas Eder 2023-01-23 09:28:44 +01:00
parent eb0107ad2d
commit 4882d723ba
4 changed files with 57 additions and 3 deletions

View File

@ -51,7 +51,15 @@ import org.jooq.impl.QOM.UEmpty;
/**
* @author Lukas Eder
*/
final class FalseCondition extends AbstractCondition implements False, UEmpty, SimpleQueryPart {
final class FalseCondition
extends
AbstractCondition
implements
False,
QOM.False,
UEmpty,
SimpleQueryPart
{
private static final Clause[] CLAUSES = { CONDITION, CONDITION_COMPARISON };
static final FalseCondition INSTANCE = new FalseCondition();

View File

@ -57,7 +57,15 @@ import org.jooq.impl.QOM.UEmpty;
/**
* @author Lukas Eder
*/
final class NullCondition extends AbstractCondition implements Null, UEmpty, SimpleQueryPart {
final class NullCondition
extends
AbstractCondition
implements
Null,
QOM.Null,
UEmpty,
SimpleQueryPart
{
private static final Clause[] CLAUSES = { CONDITION, CONDITION_COMPARISON };
static final NullCondition INSTANCE = new NullCondition();

View File

@ -840,6 +840,36 @@ public final class QOM {
// XXX: Conditions
// -------------------------------------------------------------------------
/**
* A {@link Condition} that is always <code>TRUE</code>.
*/
public sealed interface True
extends
Condition
permits
TrueCondition
{}
/**
* A {@link Condition} that is always <code>FALSE</code>.
*/
public sealed interface False
extends
Condition
permits
FalseCondition
{}
/**
* A {@link Condition} that is always <code>NULL</code>.
*/
public sealed interface Null
extends
Condition
permits
NullCondition
{}
/**
* A {@link Condition} consisting of two {@link Condition} operands and a
* binary logic {@link Operator}.

View File

@ -71,7 +71,15 @@ import org.jooq.impl.QOM.UEmpty;
/**
* @author Lukas Eder
*/
final class TrueCondition extends AbstractCondition implements True, UEmpty, SimpleQueryPart {
final class TrueCondition
extends
AbstractCondition
implements
True,
QOM.True,
UEmpty,
SimpleQueryPart
{
private static final Clause[] CLAUSES = { CONDITION, CONDITION_COMPARISON };
static final TrueCondition INSTANCE = new TrueCondition();