Package org.apache.juneau.objecttools
Class ObjectPaginator
java.lang.Object
org.apache.juneau.objecttools.ObjectPaginator
- All Implemented Interfaces:
ObjectTool<PageArgs>
POJO model paginator.
This class is designed to extract sublists from arrays/collections of maps or beans.
Example:
MyBean[]
The tool can be used against the following data types:
- Arrays/collections of maps or beans.
See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic ObjectPaginator
create()
Static creator.<R> List<R>
Convenience method for executing the paginator.run
(BeanSession session, Object input, PageArgs args) Converts the specified input to some other output.
-
Constructor Details
-
ObjectPaginator
public ObjectPaginator()
-
-
Method Details
-
create
Static creator.- Returns:
- A new
ObjectPaginator
object.
-
run
Convenience method for executing the paginator.- Type Parameters:
R
- The collection element type.- Parameters:
input
- The input. Must be a collection or array of objects.pos
- The zero-index position to start from.limit
- The max number of entries to retrieve.- Returns:
- A sublist of representing the entries from the position with the specified limit.
-
run
Description copied from interface:ObjectTool
Converts the specified input to some other output.- Specified by:
run
in interfaceObjectTool<PageArgs>
- Parameters:
session
- The current bean session.input
- The input POJO.args
- The arguments.- Returns:
- The output POJO.
-