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

io.quarkus.redis.datasource.search.AggregationResponse Maven / Gradle / Ivy

There is a newer version: 3.17.5
Show newest version
package io.quarkus.redis.datasource.search;

import java.util.Collections;
import java.util.List;

/**
 * Represents the response of the {@code ft.aggregate} command.
 */
public class AggregationResponse {

    private final long cursor;

    private final List documents;
    private final int count;

    public AggregationResponse(long cursor, List results) {
        this.cursor = cursor;
        this.count = results.size();
        this.documents = Collections.unmodifiableList(results);
    }

    public AggregationResponse(List results) {
        this(-1, results);
    }

    /**
     * @return the number of document.
     */
    public int count() {
        return count;
    }

    /**
     * @return the cursor id, {@code -1} if the command didn't pass {@code WITHCURSOR}, 0 when the cursor reached the
     *         end of the data set.
     */
    public long cursor() {
        return cursor;
    }

    /**
     * @return the list of document.
     */
    public List documents() {
        return documents;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy