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

com.gitee.cn9750wang.webtools.vo.page.EmptyPage Maven / Gradle / Ivy

The newest version!
/*
 *    Copyright 2021 wwy
 *
 *    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.gitee.cn9750wang.webtools.vo.page;

import java.util.Collection;
import java.util.Collections;

/**
 * 空分页对象
 * @author anonym
 */
public class EmptyPage implements Page {

    private static final long serialVersionUID = 1L;

    /** 私有化构造函数,禁止被其他开发者实例化 */
    private EmptyPage(){}

    /** 空分页对象 */
    private static final EmptyPage EMPTY_PAGE = new EmptyPage();

    /**
     * 获取空分页对象实例
     * @return 空分页对象实例
     */
    public static EmptyPage emptyPage(){
        return EMPTY_PAGE;
    }

    @Override
    public Collection getItems() {
        return Collections.emptyList();
    }

    @Override
    public long getTotal() {
        return 0;
    }

    @Override
    public long getPage() {
        return 1;
    }

    @Override
    public String toString() {
        return "EmptyPage{items={},total=0,page=1}";
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy