use of com.google.firebase.firestore.core.CompositeFilter in project firebase-android-sdk by firebase.
the class SQLiteIndexManager method getSubTargets.
private List<Target> getSubTargets(Target target) {
if (targetToDnfSubTargets.containsKey(target)) {
return targetToDnfSubTargets.get(target);
}
List<Target> subTargets = new ArrayList<>();
if (target.getFilters().isEmpty()) {
subTargets.add(target);
} else {
// There is an implicit AND operation between all the filters stored in the target.
List<Filter> dnf = LogicUtils.DnfTransform(new CompositeFilter(target.getFilters(), StructuredQuery.CompositeFilter.Operator.AND));
for (Filter term : dnf) {
subTargets.add(new Target(target.getPath(), target.getCollectionGroup(), term.getFilters(), target.getOrderBy(), target.getLimit(), target.getStartAt(), target.getEndAt()));
}
}
targetToDnfSubTargets.put(target, subTargets);
return subTargets;
}
Aggregations