Package com.datastax.driver.core
Class PagingState
- java.lang.Object
-
- com.datastax.driver.core.PagingState
-
public class PagingState extends Object
The paging state of a query.This object represents the next page to be fetched if the query is multi page. It can be saved and reused later on the same statement.
The PagingState can be serialized and deserialized either as a String or as a byte array.
- See Also:
Statement.setPagingState(PagingState)
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PagingStatefromBytes(byte[] pagingState)Create a PagingState object from a byte array previously generated withtoBytes().static PagingStatefromString(String string)Create a PagingState object from a string previously generated withtoString().byte[]toBytes()Return a representation of the paging state object as a byte array.StringtoString()
-
-
-
Method Detail
-
fromString
public static PagingState fromString(String string)
Create a PagingState object from a string previously generated withtoString().- Parameters:
string- the string value.- Returns:
- the PagingState object created.
- Throws:
PagingStateException- if the string does not have the correct format.
-
toBytes
public byte[] toBytes()
Return a representation of the paging state object as a byte array.- Returns:
- the paging state as a byte array.
-
fromBytes
public static PagingState fromBytes(byte[] pagingState)
Create a PagingState object from a byte array previously generated withtoBytes().- Parameters:
pagingState- The byte array representation.- Returns:
- the PagingState object created.
- Throws:
PagingStateException- if the byte array does not have the correct format.
-
-