fix paged list json.

Signed-off-by: Michael Hirsch <michael.hirsch@bosch-si.com>
This commit is contained in:
Michael Hirsch
2016-04-05 15:02:55 +02:00
parent 9c9bdf6406
commit 39fc74469f

View File

@@ -36,7 +36,7 @@ public class PagedList<T> extends ResourceSupport {
@JsonProperty
private final List<T> content;
@JsonProperty
private final long totalElements;
private final long total;
private final int size;
/**
@@ -45,16 +45,15 @@ public class PagedList<T> extends ResourceSupport {
*
* @param content
* the actual content of the list
* @param totalElements
* @param total
* the total amount of elements
* @throws NullPointerException
* in case {@code content} is {@code null}.
*/
@JsonCreator
public PagedList(@JsonProperty("content") @NotNull final List<T> content,
@JsonProperty("totalElements") final long totalElements) {
public PagedList(@JsonProperty("content") @NotNull final List<T> content, @JsonProperty("total") final long total) {
this.size = content.size();
this.totalElements = totalElements;
this.total = total;
this.content = content;
}
@@ -69,7 +68,7 @@ public class PagedList<T> extends ResourceSupport {
* @return the total amount of elements
*/
public long getTotal() {
return totalElements;
return total;
}
public List<T> getContent() {