001/* 002 * Licensed to DuraSpace under one or more contributor license agreements. 003 * See the NOTICE file distributed with this work for additional information 004 * regarding copyright ownership. 005 * 006 * DuraSpace licenses this file to you under the Apache License, 007 * Version 2.0 (the "License"); you may not use this file except in 008 * compliance with the License. You may obtain a copy of the License at 009 * 010 * http://www.apache.org/licenses/LICENSE-2.0 011 * 012 * Unless required by applicable law or agreed to in writing, software 013 * distributed under the License is distributed on an "AS IS" BASIS, 014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 015 * See the License for the specific language governing permissions and 016 * limitations under the License. 017 */ 018package org.fcrepo.search.api; 019 020import com.fasterxml.jackson.annotation.JsonProperty; 021 022/** 023 * A data structure representing the pagination information associated with a {@link org.fcrepo.search.api.SearchResult} 024 * 025 * @author dbernstein 026 */ 027public class PaginationInfo { 028 @JsonProperty 029 private int offset = -1; 030 @JsonProperty 031 private int maxResults = -1; 032 033 /** 034 * Default constructor 035 */ 036 public PaginationInfo() { } 037 038 /** 039 * Constructor 040 * 041 * @param maxResults max results asked off 042 * @param offset offset of the first result item 043 */ 044 public PaginationInfo(final int maxResults, final int offset) { 045 this.maxResults = maxResults; 046 this.offset = offset; 047 } 048 049 /** 050 * The max results of the original query 051 * @return 052 */ 053 public int getMaxResults() { 054 return maxResults; 055 } 056 057 /** 058 * The offset specified by original query 059 * @return 060 */ 061 public int getOffset() { 062 return offset; 063 } 064}