fix paged list json.
Signed-off-by: Michael Hirsch <michael.hirsch@bosch-si.com>
This commit is contained in:
@@ -36,7 +36,7 @@ public class PagedList<T> extends ResourceSupport {
|
|||||||
@JsonProperty
|
@JsonProperty
|
||||||
private final List<T> content;
|
private final List<T> content;
|
||||||
@JsonProperty
|
@JsonProperty
|
||||||
private final long totalElements;
|
private final long total;
|
||||||
private final int size;
|
private final int size;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -45,16 +45,15 @@ public class PagedList<T> extends ResourceSupport {
|
|||||||
*
|
*
|
||||||
* @param content
|
* @param content
|
||||||
* the actual content of the list
|
* the actual content of the list
|
||||||
* @param totalElements
|
* @param total
|
||||||
* the total amount of elements
|
* the total amount of elements
|
||||||
* @throws NullPointerException
|
* @throws NullPointerException
|
||||||
* in case {@code content} is {@code null}.
|
* in case {@code content} is {@code null}.
|
||||||
*/
|
*/
|
||||||
@JsonCreator
|
@JsonCreator
|
||||||
public PagedList(@JsonProperty("content") @NotNull final List<T> content,
|
public PagedList(@JsonProperty("content") @NotNull final List<T> content, @JsonProperty("total") final long total) {
|
||||||
@JsonProperty("totalElements") final long totalElements) {
|
|
||||||
this.size = content.size();
|
this.size = content.size();
|
||||||
this.totalElements = totalElements;
|
this.total = total;
|
||||||
this.content = content;
|
this.content = content;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -69,7 +68,7 @@ public class PagedList<T> extends ResourceSupport {
|
|||||||
* @return the total amount of elements
|
* @return the total amount of elements
|
||||||
*/
|
*/
|
||||||
public long getTotal() {
|
public long getTotal() {
|
||||||
return totalElements;
|
return total;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<T> getContent() {
|
public List<T> getContent() {
|
||||||
|
|||||||
Reference in New Issue
Block a user