package com.atlassian.bitbucket.mesh.util;

/**
 * Describes the range to return to populate a page of data.
 */
public class PageRange {

    private final int limit;
    private final int start;

    public PageRange(int limit, int start) {
        this.limit = limit > 0 ? limit : Integer.MAX_VALUE;
        this.start = start;
    }

    /**
     * @return the maximum number of elements to return for the page
     */
    public int getLimit() {
        return limit;
    }

    /**
     * @return the zero-based index of the first element to include on the page
     */
    public int getStart() {
        return start;
    }
}
