DataBufferUtils

public final classDataBufferUtilsextendsObject

Utilities for working withDataBufferobjects.

Public Method Summary

static <T, E extendsFreezable<T>> ArrayList<T>
freezeAndClose(DataBuffer<E> buffer)
Utility helper method to freeze a DataBuffer into a list of concrete entities.
static boolean
hasData(DataBuffer<?> buffer)
Utility function to determine whether a data buffer has data or not.
static boolean
hasNextPage(DataBuffer<?> buffer)
Utility function to get the "next page" pagination token from a data buffer.
static boolean
hasPrevPage(DataBuffer<?> buffer)
Utility function to get the "prev page" pagination token from a data buffer.

Inherited Method Summary

Public Methods

public staticArrayList<T> freezeAndClose(DataBuffer<E> buffer)

Utility helper method to freeze a DataBuffer into a list of concrete entities. The DataBuffer provided here must contain elements that implement theFreezable 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 asE.

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

Parameters
buffer DataBufferto freeze contents from.
Returns
  • ArrayList of objects represented by the buffer.

public static booleanhasData(DataBuffer<?> buffer)

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

Parameters
buffer The data buffer to check.
Returns
  • Whether the data buffer has data or not.

public static booleanhasNextPage(DataBuffer<?> buffer)

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

public static booleanhasPrevPage(DataBuffer<?> buffer)

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