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

io.sphere.client.model.QueryResult Maven / Gradle / Ivy

There is a newer version: 0.72.1
Show newest version
package io.sphere.client.model;

import javax.annotation.Nonnull;
import java.util.List;
import java.util.ArrayList;
import java.util.Collection;

/** Result of a query to the Sphere backend. */
public class QueryResult {
    private int offset;
    private int count;
    private int total;
    @Nonnull List results = new ArrayList();

    public QueryResult(int skipped, int count, int total, Collection results) {
        this.offset = skipped;
        this.count = count;
        this.total = total;
        this.results = new ArrayList(results);
    }

    // for JSON deserializer
    private QueryResult() { }

    /** Offset from the start, begins at 0. */
    public int getOffset() { return offset; }
    /** Number of results returned. */
    public int getCount() { return count; }
    /** Total number of results in the result set. */
    public int getTotal() { return total; }
    /** The total results in the result set. */
    @Nonnull public List getResults() { return results; }

    @Override
    public String toString() {
        return "QueryResult{" +
                "offset=" + offset +
                ", count=" + count +
                ", total=" + total +
                ", results=" + results +
                '}';
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy