org.infinitenature.commons.pagination.Slice Maven / Gradle / Ivy
package org.infinitenature.commons.pagination;
import java.util.*;
public interface Slice extends Iterable
{
/**
* Returns the page content as unmodifiable {@link List}.
*
* @return
*/
List getContent();
/**
* Returns whether the {@link Slice} has content at all.
*
* @return
*/
boolean hasContent();
/**
* Returns the size of the {@link Slice}.
*
* @return the size of the {@link Slice}.
*/
int getSize();
/**
* Returns the number of elements currently on this {@link Slice}.
*
* @return the number of elements currently on this {@link Slice}.
*/
int getNumberOfElements();
/**
* Returns the sort order of this {@link Slice}.
*
* @return the sort order of this {@link Slice}.
*/
Optional getSortOrder();
/**
* Returns the sort field of this {@link Slice}.
*
* @return the sort field of this {@link Slice}.
*/
Optional getSortField();
}