RowBounds.java

  1. /*
  2.  *    Copyright 2009-2022 the original author or authors.
  3.  *
  4.  *    Licensed under the Apache License, Version 2.0 (the "License");
  5.  *    you may not use this file except in compliance with the License.
  6.  *    You may obtain a copy of the License at
  7.  *
  8.  *       https://www.apache.org/licenses/LICENSE-2.0
  9.  *
  10.  *    Unless required by applicable law or agreed to in writing, software
  11.  *    distributed under the License is distributed on an "AS IS" BASIS,
  12.  *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13.  *    See the License for the specific language governing permissions and
  14.  *    limitations under the License.
  15.  */
  16. package org.apache.ibatis.session;

  17. /**
  18.  * @author Clinton Begin
  19.  */
  20. public class RowBounds {

  21.   public static final int NO_ROW_OFFSET = 0;
  22.   public static final int NO_ROW_LIMIT = Integer.MAX_VALUE;
  23.   public static final RowBounds DEFAULT = new RowBounds();

  24.   private final int offset;
  25.   private final int limit;

  26.   public RowBounds() {
  27.     this.offset = NO_ROW_OFFSET;
  28.     this.limit = NO_ROW_LIMIT;
  29.   }

  30.   public RowBounds(int offset, int limit) {
  31.     this.offset = offset;
  32.     this.limit = limit;
  33.   }

  34.   public int getOffset() {
  35.     return offset;
  36.   }

  37.   public int getLimit() {
  38.     return limit;
  39.   }

  40. }