org.javaswift.joss.client.core
Class AbstractPaginationMap<Child extends ListSubject>

java.lang.Object
  extended by org.javaswift.joss.client.core.AbstractPaginationMap<Child>
All Implemented Interfaces:
PaginationMap
Direct Known Subclasses:
AccountPaginationMap, ContainerPaginationMap

public abstract class AbstractPaginationMap<Child extends ListSubject>
extends Object
implements PaginationMap


Field Summary
static org.slf4j.Logger LOG
           
 
Constructor Summary
AbstractPaginationMap(ListHolder<Child> listHolder, String prefix, int pageSize)
           
 
Method Summary
 AbstractPaginationMap buildMap()
           
 String getMarker(Integer page)
          Gets the marker text (ie, the name of the last record of the previous page) for navigating to another page.
 int getNumberOfPages()
          Returns the number of pages
 int getNumberOfRecords()
          Returns the number of records
 int getPageSize()
          Returns the page size
 String getPrefix()
          Returns the prefix which is used to search the records
 Collection<Child> listAllItems()
           
 AbstractPaginationMap setBlockSize(int blockSize)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

public static final org.slf4j.Logger LOG
Constructor Detail

AbstractPaginationMap

public AbstractPaginationMap(ListHolder<Child> listHolder,
                             String prefix,
                             int pageSize)
Method Detail

buildMap

public AbstractPaginationMap buildMap()

listAllItems

public Collection<Child> listAllItems()

getMarker

public String getMarker(Integer page)
Description copied from interface: PaginationMap
Gets the marker text (ie, the name of the last record of the previous page) for navigating to another page. The OpenStack API requires this information (why don't they use a regular offset?).

Specified by:
getMarker in interface PaginationMap
Parameters:
page - the page to get the appropriate marker for
Returns:
the marker for the required page

getNumberOfPages

public int getNumberOfPages()
Description copied from interface: PaginationMap
Returns the number of pages

Specified by:
getNumberOfPages in interface PaginationMap
Returns:
number of pages

getPageSize

public int getPageSize()
Description copied from interface: PaginationMap
Returns the page size

Specified by:
getPageSize in interface PaginationMap
Returns:
page size

getNumberOfRecords

public int getNumberOfRecords()
Description copied from interface: PaginationMap
Returns the number of records

Specified by:
getNumberOfRecords in interface PaginationMap
Returns:
the number of records

getPrefix

public String getPrefix()
Description copied from interface: PaginationMap
Returns the prefix which is used to search the records

Specified by:
getPrefix in interface PaginationMap
Returns:
the prefix

setBlockSize

public AbstractPaginationMap setBlockSize(int blockSize)


Copyright © 2012-2014 42 BV. All Rights Reserved.