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

com.gitee.cn9750wang.webtools.query.AbstractQuery 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.query;

import com.gitee.cn9750wang.webtools.query.empty.EmptyLimitPage;

/**
 * 查询条件
 *
 * @author wwy
 */
public abstract class AbstractQuery {

    /** 分页查询条件 */
    private LimitPage page;

    /** 排序 */
    private Sort sort;

    public LimitPage getPage() {
        return page != null ? page : EmptyLimitPage.getInstance();
    }

    public Sort getSort() {
        return sort;
    }

    public void setPage(LimitPage page) {
        this.page = page;
    }

    public void setSort(Sort sort) {
        this.sort = sort;
    }

    public void setP(String page) {
        this.setPage(page);
    }

    public void setS(String sort) {
        this.setSort(sort);
    }

    public void setPage(String page) {
        this.setPage(new LimitPage(page));
    }

    public void setSort(String sort) {
        this.setSort(new Sort(sort));
    }

    @Override
    public String toString() {
        return "Query{" +
                "page=" + page +
                ", sort=" + sort +
                '}';
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy