com.github.rutledgepaulv.qbuilders.delegates.concrete.BooleanPropertyDelegate Maven / Gradle / Ivy
package com.github.rutledgepaulv.qbuilders.delegates.concrete;
import com.github.rutledgepaulv.qbuilders.builders.QBuilder;
import com.github.rutledgepaulv.qbuilders.conditions.Condition;
import com.github.rutledgepaulv.qbuilders.delegates.virtual.ExistentialPropertyDelegate;
import com.github.rutledgepaulv.qbuilders.operators.ComparisonOperator;
import com.github.rutledgepaulv.qbuilders.properties.concrete.BooleanProperty;
import com.github.rutledgepaulv.qbuilders.structures.FieldPath;
import java.util.Collections;
public final class BooleanPropertyDelegate> extends ExistentialPropertyDelegate implements BooleanProperty {
public BooleanPropertyDelegate(FieldPath field, T canonical) {
super(field, canonical);
}
public final Condition isTrue() {
return condition(getField(), ComparisonOperator.EQ, Collections.singletonList(true));
}
public final Condition isFalse() {
return condition(getField(), ComparisonOperator.EQ, Collections.singletonList(false));
}
}