001/*
002 * Copyright 2011-2016 UnboundID Corp.
003 *
004 * This program is free software; you can redistribute it and/or modify
005 * it under the terms of the GNU General Public License (GPLv2 only)
006 * or the terms of the GNU Lesser General Public License (LGPLv2.1 only)
007 * as published by the Free Software Foundation.
008 *
009 * This program is distributed in the hope that it will be useful,
010 * but WITHOUT ANY WARRANTY; without even the implied warranty of
011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
012 * GNU General Public License for more details.
013 *
014 * You should have received a copy of the GNU General Public License
015 * along with this program; if not, see <http://www.gnu.org/licenses>.
016 */
017
018package com.unboundid.scim.sdk;
019
020
021
022/**
023 * This class represents the pagination parameters in a SCIM request.
024 */
025public final class PageParameters
026{
027  /**
028   * The offset of the first resource to be returned.
029   */
030  private final int startIndex;
031
032  /**
033   * The maximum number of resources to return in a single page, or zero if the
034   * server should choose how many to return.
035   */
036  private final int count;
037
038
039
040  /**
041   * Create a new instance of pagination parameters.
042   *
043   * @param startIndex The offset of the first resource to be returned.
044   * @param count      The maximum number of resources to return in a single
045   *                   page, or zero if the server should choose how many to
046   *                   return.
047   */
048  public PageParameters(final int startIndex, final int count)
049  {
050    this.startIndex = startIndex;
051    this.count = count;
052  }
053
054
055
056  /**
057   * Retrieve the offset of the first resource to be returned.
058   *
059   * @return The offset of the first resource to be returned.
060   */
061  public int getStartIndex()
062  {
063    return startIndex;
064  }
065
066
067
068  /**
069   * Retrieve the maximum number of resources to return in a single page, or
070   * zero if the server should choose how many to return.
071   *
072   * @return The maximum number of resources to return in a single page, or
073   *         zero if the server should choose how many to return.
074   */
075  public int getCount()
076  {
077    return count;
078  }
079}