org.coodex.commons.jpa.springdata.PageCopier Maven / Gradle / Ivy
/*
* Copyright (c) 2017 coodex.org ([email protected])
*
* 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 org.coodex.commons.jpa.springdata;
import org.coodex.concrete.api.pojo.PageResult;
import org.coodex.concrete.common.Copier;
import org.springframework.data.domain.Page;
/**
* Created by davidoff shen on 2017-03-21.
*/
@Deprecated
public class PageCopier {
@Deprecated
public static PageResult copy(Page srcPage, Copier copier) {
// PageResult result = new PageResult();
// result.setCount(srcPage.getTotalElements());
// result.setTotal((long) srcPage.getTotalPages());
// result.setNum((long) srcPage.getNumber());
// result.setPageSize(srcPage.getSize());
// result.setList(new ArrayList());
// for (SRC src : srcPage.getContent()) {
// result.getList().add(copier.copy(src));
// }
// return result;
return PageHelper.copy(srcPage, copier);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy