
com.alon.spring.crud.resource.dto.EntityListOutputConverter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spring-crud-base Show documentation
Show all versions of spring-crud-base Show documentation
Projeto base para criação de serviços e recusos de CRUD com Spring Data JPA.
package com.alon.spring.crud.resource.dto;
import com.alon.spring.crud.model.BaseEntity;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Component;
@Component
public class EntityListOutputConverter implements OutputDtoConverter, EntityListOutput> {
@Override
public EntityListOutput convert(Page data) {
EntityListOutput output = new EntityListOutput();
output.content = data.getContent();
output.page = data.getNumber() + 1;
output.pageSize = data.getContent().size();
output.totalPages = data.getTotalPages();
output.totalSize = data.getNumberOfElements();
return output;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy