All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.gvnix.web.datatables.query.SearchResults Maven / Gradle / Ivy

The newest version!
/*
 * gvNIX is an open source tool for rapid application development (RAD).
 * Copyright (C) 2010 Generalitat Valenciana
 *
* This program is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation, either version 3 of the License, or (at your option) any later
 * version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 * details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program. If not, see .
 */
package org.gvnix.web.datatables.query;

import java.util.List;

/**
 * Data bundle for paged search results
 * 
 * @author DISID Corporation S.L. made for General Directorate for Information
 *         Technologies (DGTI)
 * @param 
 */
public class SearchResults {

    /**
     * Create a bundle of query results.
     * 
     * @param result the entities found
     * @param resultsCount amount of entities found taking in account search and
     *        paging criterias
     * @param isPagedResult true if results are in given page
     * @param startItem page starts at this item index
     * @param pageSize amount of entities in this page
     * @param totalCount total amount of entities without paging
     */
    public SearchResults(List result, long resultsCount,
            boolean isPagedResult, long startItem, long pageSize,
            long totalCount) {
        super();
        this.results = result;
        this.resultsCount = resultsCount;
        this.isPagedResult = isPagedResult;
        this.startItem = startItem;
        this.pageSize = pageSize;
        this.totalCount = totalCount;
    }

    private final List results;

    private final long totalCount;

    private final long resultsCount;

    private final boolean isPagedResult;

    private final long startItem;

    private final long pageSize;

    /**
     * @return list of entities found
     */
    public List getResults() {
        return results;
    }

    /**
     * @return amount of entities found
     */
    public long getResultsCount() {
        return resultsCount;
    }

    /**
     * @return true if entities found are in given page
     */
    public boolean isPagedResult() {
        return isPagedResult;
    }

    /**
     * @return page starts at this item index
     */
    public long getStartItem() {
        return startItem;
    }

    /**
     * @return amount of entities in this page
     */
    public long getPageSize() {
        return pageSize;
    }

    /**
     * @return total amount of entities without paging
     */
    public long getTotalCount() {
        return totalCount;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy