Package com.apple.foundationdb.record
Class RecordCursorStartContinuation
- java.lang.Object
-
- com.apple.foundationdb.record.RecordCursorStartContinuation
-
- All Implemented Interfaces:
RecordCursorContinuation
@API(INTERNAL) public class RecordCursorStartContinuation extends Object implements RecordCursorContinuation
A continuation representing the start of a cursor's execution. This continuation is not perfectly well behaved, for historical reasons. Specifically, its binary serialization isnull
, which is the same as the binary serialization ofRecordCursorEndContinuation
. As a result, the two are distinguishable only through the result ofisEnd()
. Because a start continuation is only used internally and a continuation can be obtained only with aRecordCursorResult
---at which point the cursor is no longer at its "start"---there is no ambiguity to an external API consumer. However, it remains a potential pitfall.
-
-
Field Summary
Fields Modifier and Type Field Description static RecordCursorContinuation
START
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isEnd()
Return whether this continuation is an "end continuation", i.e., represents that the iteration has reached its end and would not produce more results even if restarted.byte[]
toBytes()
Serialize this continuation to a byte array.
-
-
-
Field Detail
-
START
public static final RecordCursorContinuation START
-
-
Method Detail
-
isEnd
public boolean isEnd()
Description copied from interface:RecordCursorContinuation
Return whether this continuation is an "end continuation", i.e., represents that the iteration has reached its end and would not produce more results even if restarted. IfisEnd()
returnstrue
, thenRecordCursorContinuation.toBytes()
must returnnull
.- Specified by:
isEnd
in interfaceRecordCursorContinuation
- Returns:
- whether this continuation represents the end of a cursor's iteration
-
toBytes
@Nullable public byte[] toBytes()
Description copied from interface:RecordCursorContinuation
Serialize this continuation to a byte array. This method must always return the same array contents (but not necessarily the same array). IfRecordCursorContinuation.isEnd()
returnstrue
, thentoBytes()
must returnnull
.- Specified by:
toBytes
in interfaceRecordCursorContinuation
- Returns:
- a (possibly null) byte array containing a binary serialization of this continuation
-
-