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

com.plenigo.sdk.models.PagedList Maven / Gradle / Ivy

There is a newer version: 1.7.2
Show newest version
package com.plenigo.sdk.models;

import com.plenigo.sdk.internal.models.PagingInfo;

import java.util.List;

/**
 * 

* This object represents a paged list. *

*

* Thread safety: This class is thread safe and can be injected. *

* * @param The type of list to be used */ public class PagedList { private List list; private PagingInfo pagingInfo; /** * Required constructor. * * @param list The paged list * @param pagingInfo The paging information */ public PagedList(List list, PagingInfo pagingInfo) { this.list = list; this.pagingInfo = pagingInfo; if (pagingInfo == null) { this.pagingInfo = new PagingInfo("", 0, 0); } } /** * Retrieves the list of paged elements. * * @return a list of elements */ public List getList() { return list; } /** * The last id for further paged requests. * * @return The last id */ public String getLastId() { return pagingInfo.getLastId(); } /** * The amount of returned elements. * * @return the amount of returned elements */ public int getPageSize() { return pagingInfo.getPageSize(); } /** * Amout of total elements. * * @return The total elements */ public int getTotalElements() { return pagingInfo.getTotalElements(); } @Override public String toString() { return "PagedList{" + "list=" + list + ", pagingInfo=" + pagingInfo + '}'; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy