1 package org.apache.archiva.indexer.search;
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License. You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied. See the License for the
18 * specific language governing permissions and limitations
23 * SearchResultLimits - used to provide the search some limits on how the results are returned.
24 * This can provide paging for the result
26 public class SearchResultLimits
29 * Constant to use for {@link #setSelectedPage(int)} to indicate a desire to get ALL PAGES.
32 public static final int ALL_PAGES = ( -1 );
34 private int pageSize = 30;
36 private int selectedPage = 0;
39 * @param selectedPage page selected use -1 for all pages
41 public SearchResultLimits( int selectedPage )
43 this.selectedPage = selectedPage;
47 * @param pageSize number of groupId:artifact per page
48 * @param selectedPage page selected use -1 for all pages
51 public SearchResultLimits( int pageSize, int selectedPage )
53 this.pageSize = pageSize;
54 this.selectedPage = selectedPage;
57 public int getPageSize()
63 * Set page size for maximum # of hits to return per page.
65 * @param pageSize size of page by # of hits.
67 public void setPageSize( int pageSize )
69 this.pageSize = pageSize;
72 public int getSelectedPage()
77 public void setSelectedPage( int selectedPage )
79 this.selectedPage = selectedPage;
83 public String toString()
85 return "SearchResultLimits{" + "pageSize=" + pageSize + ", selectedPage=" + selectedPage + '}';