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

com.salesmanager.shop.util.ReadableEntityUtil Maven / Gradle / Ivy

The newest version!
package com.salesmanager.shop.util;

import com.salesmanager.shop.model.entity.ReadableEntityList;
import org.springframework.data.domain.Page;

import java.util.List;

public final class ReadableEntityUtil {

    private ReadableEntityUtil() {}

    public static   ReadableEntityList createReadableList(Page availabilities, List items) {
        ReadableEntityList readableList = new ReadableEntityList<>();
        readableList.setItems(items);
        readableList.setTotalPages(availabilities.getTotalPages());
        readableList.setRecordsTotal(availabilities.getTotalElements());
        readableList.setNumber(availabilities.getNumber());
        return readableList;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy