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

run.halo.app.extension.index.query.IsNull Maven / Gradle / Ivy

The newest version!
package run.halo.app.extension.index.query;

import java.util.NavigableSet;

public class IsNull extends SimpleQuery {

    protected IsNull(String fieldName) {
        super(fieldName, null);
    }

    @Override
    public NavigableSet matches(QueryIndexView indexView) {
        indexView.acquireReadLock();
        try {
            var allIds = indexView.getAllIds();
            var idsForNonNullValue = indexView.getIdsForField(fieldName);
            allIds.removeAll(idsForNonNullValue);
            return allIds;
        } finally {
            indexView.releaseReadLock();
        }
    }

    @Override
    public String toString() {
        return fieldName + " IS NULL";
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy