com.github.rutledgepaulv.qbuilders.delegates.virtual.ExistentialPropertyDelegate Maven / Gradle / Ivy
package com.github.rutledgepaulv.qbuilders.delegates.virtual;
import com.github.rutledgepaulv.qbuilders.builders.QBuilder;
import com.github.rutledgepaulv.qbuilders.conditions.Condition;
import com.github.rutledgepaulv.qbuilders.operators.ComparisonOperator;
import com.github.rutledgepaulv.qbuilders.properties.virtual.ExistentialProperty;
import com.github.rutledgepaulv.qbuilders.structures.FieldPath;
import java.util.Collections;
public abstract class ExistentialPropertyDelegate> extends PropertyDelegate
implements ExistentialProperty {
protected ExistentialPropertyDelegate(FieldPath field, T canonical) {
super(field, canonical);
}
public final Condition exists() {
return condition(getField(), ComparisonOperator.EX, Collections.singletonList(true));
}
public final Condition doesNotExist() {
return condition(getField(), ComparisonOperator.EX, Collections.singletonList(false));
}
}