DataBufferUtils

class DataBufferUtils


Utilities for working with DataBuffer objects.

Summary

Public functions

java-static ArrayList<T!>!
<T, E : Freezable<T!>?> freezeAndClose(buffer: DataBuffer<E!>!)

Utility helper method to freeze a DataBuffer into a list of concrete entities.

java-static Boolean
hasData(buffer: DataBuffer<Any!>!)

Utility function to determine whether a data buffer has data or not.

java-static Boolean

Utility function to get the "next page" pagination token from a data buffer.

java-static Boolean

Utility function to get the "prev page" pagination token from a data buffer.

Public functions

freezeAndClose

java-static fun <T, E : Freezable<T!>?> freezeAndClose(buffer: DataBuffer<E!>!): ArrayList<T!>!

Utility helper method to freeze a DataBuffer into a list of concrete entities. The DataBuffer provided here must contain elements that implement the Freezable interface.

Note that this will close the buffer, so do not attempt to use it afterwards.

Type T is the type of object returned by freezing an element of the DataBuffer. In most cases, this will be the same as E.

Type E is the type of object contained by the DataBuffer. Must implement Freezable.

Parameters
buffer: DataBuffer<E!>!

DataBuffer to freeze contents from.

Returns
ArrayList<T!>!

ArrayList of objects represented by the buffer.

hasData

java-static fun hasData(buffer: DataBuffer<Any!>!): Boolean

Utility function to determine whether a data buffer has data or not.

Parameters
buffer: DataBuffer<Any!>!

The data buffer to check.

Returns
Boolean

Whether the data buffer has data or not.

hasNextPage

java-static fun hasNextPage(buffer: DataBuffer<Any!>!): Boolean

Utility function to get the "next page" pagination token from a data buffer.

hasPrevPage

java-static fun hasPrevPage(buffer: DataBuffer<Any!>!): Boolean

Utility function to get the "prev page" pagination token from a data buffer.