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

com.github.flysium.io.yew.common.jdbc.PageModel Maven / Gradle / Ivy

There is a newer version: 1.0.4
Show newest version
/*
 * Copyright 2018-2025 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.github.flysium.io.yew.common.jdbc;

import java.util.List;
import lombok.Data;

/**
 * Paging result
 *
 * @author SvenAugustus
 * @version 1.0
 * @since JDK 1.7
 */
@Data
public class PageModel {

	/**
	 * the result list
	 */
	private List list = null;
	/**
	 * the current page index
	 */
	private long pageIndex = 1;
	/**
	 * number of rows per page
	 */
	private long pageSize = 10;
	/**
	 * number of total pages
	 */
	private long pageCount = 0;
	/**
	 * number of total rows
	 */
	private long totalCount = 0;

	public long countStartIndex() {
		long startIndex = (pageIndex - 1) * pageSize;
		return startIndex < 0 ? 0 : startIndex;
	}

	public long countEndIndex() {
		long endIndex = pageIndex * pageSize;
		return endIndex < 0 ? 0 : endIndex;
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy