All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.openl.rules.rest.model.PageResponse Maven / Gradle / Ivy

There is a newer version: 5.27.9
Show newest version
package org.openl.rules.rest.model;

import java.util.Collection;

import io.swagger.v3.oas.annotations.Parameter;

public class PageResponse {

    @Parameter(description = "Current page content")
    private final Collection content;

    @Parameter(description = "Current page number", required = true)
    private final int pageNumber;

    @Parameter(description = "Page size", required = true)
    private final int pageSize;

    @Parameter(description = "Number of items on the current page", required = true)
    private final int numberOfElements;

    public PageResponse(Collection content, int pageNumber, int pageSize) {
        this.content = content;
        this.pageNumber = pageNumber;
        this.pageSize = pageSize;
        this.numberOfElements = content == null ? 0 : content.size();
    }

    public Collection getContent() {
        return content;
    }

    public int getPageNumber() {
        return pageNumber;
    }

    public int getPageSize() {
        return pageSize;
    }

    public int getNumberOfElements() {
        return numberOfElements;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy