com.salesmanager.shop.util.ReadableEntityUtil Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sm-shop-model Show documentation
Show all versions of sm-shop-model Show documentation
sm-shop-model contains Shopizer model objects for api
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;
}
}