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

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

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

import com.google.common.collect.Sets;
import java.util.Collection;
import java.util.NavigableSet;
import java.util.stream.Collectors;

public class Or extends LogicalQuery {

    public Or(Collection childQueries) {
        super(childQueries);
    }

    @Override
    public NavigableSet matches(QueryIndexView indexView) {
        var resultSet = Sets.newTreeSet();
        for (Query query : childQueries) {
            resultSet.addAll(query.matches(indexView));
        }
        return resultSet;
    }

    @Override
    public String toString() {
        return "(" + childQueries.stream().map(Query::toString)
            .collect(Collectors.joining(" OR ")) + ")";
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy