All Downloads are FREE. Search and download functionalities are using the official Maven repository.

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));
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy