-
Notifications
You must be signed in to change notification settings - Fork 287
Expand file tree
/
Copy pathBeerDTOPageImpl.java
More file actions
33 lines (27 loc) · 1.15 KB
/
BeerDTOPageImpl.java
File metadata and controls
33 lines (27 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package guru.springframework.spring6resttemplate.model;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import java.util.List;
/**
* Created by jt, Spring Framework Guru.
*/
@JsonIgnoreProperties(ignoreUnknown = true, value = "pageable")
public class BeerDTOPageImpl extends PageImpl<BeerDTO> {
@JsonCreator(mode = JsonCreator.Mode.PROPERTIES)
public BeerDTOPageImpl(@JsonProperty("content") List<BeerDTO> content,
@JsonProperty("number") int page,
@JsonProperty("size") int size,
@JsonProperty("totalElements") long total) {
super(content, PageRequest.of(page, size), total);
}
public BeerDTOPageImpl(List<BeerDTO> content, Pageable pageable, long total) {
super(content, pageable, total);
}
public BeerDTOPageImpl(List<BeerDTO> content) {
super(content);
}
}