Created
May 5, 2018 06:07
-
-
Save arselzer/322eacb79d571c7bda4f105992296e77 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package at.ac.tuwien.inso.sepm.ticketline.client.rest.implementation; | |
import com.fasterxml.jackson.annotation.JsonCreator; | |
import com.fasterxml.jackson.annotation.JsonIgnore; | |
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; | |
@JsonIgnoreProperties(ignoreUnknown = true) | |
public class RestResponsePage<T> extends PageImpl<T> { | |
@JsonCreator | |
public RestResponsePage(@JsonProperty("content") List<T> content, | |
@JsonProperty("number") int number, | |
@JsonProperty("size") int size, | |
@JsonProperty("totalElements") Long totalElements) { | |
super(content, PageRequest.of(number, size), totalElements); | |
} | |
@Override | |
@JsonIgnore | |
public Pageable getPageable() { | |
return super.getPageable(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment