Package io.pravega.client.tables.impl
Class IteratorStateImpl
- java.lang.Object
-
- io.pravega.client.tables.impl.IteratorStateImpl
-
- All Implemented Interfaces:
IteratorState
public class IteratorStateImpl extends java.lang.Object implements IteratorState
IteratorStateImplementation.
-
-
Field Summary
Fields Modifier and Type Field Description static IteratorStateImplEMPTYNo state.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static IteratorStateImplcopyOf(IteratorState source)Creates a newIteratorStateImplwhich is a copy of the givenIteratorState.static IteratorStateImplfromBytes(io.netty.buffer.ByteBuf serializedState)Deserializes theIteratorStateImplfrom its serialized form obtained from callinggetToken().static IteratorStateImplfromBytes(java.nio.ByteBuffer serializedState)Deserializes the IteratorState from its serialized form obtained from callingtoBytes()()} .io.netty.buffer.ByteBufgetToken()booleanisEmpty()Gets a value indicating whether thisIteratorStateinstance is empty.java.nio.ByteBuffertoBytes()Serializes thisIteratorStateto aByteBuffer.
-
-
-
Field Detail
-
EMPTY
public static final IteratorStateImpl EMPTY
No state. Providing this value will result in an iterator that starts from the beginning (i.e., not resuming an existing iteration).
-
-
Method Detail
-
toBytes
public java.nio.ByteBuffer toBytes()
Description copied from interface:IteratorStateSerializes thisIteratorStateto aByteBuffer. This can later be used to create a newIteratorStateusingIteratorState.fromBytes(ByteBuffer).- Specified by:
toBytesin interfaceIteratorState- Returns:
- A
ByteBuffer.
-
isEmpty
public boolean isEmpty()
Description copied from interface:IteratorStateGets a value indicating whether thisIteratorStateinstance is empty.- Specified by:
isEmptyin interfaceIteratorState- Returns:
- True if empty, false otherwise.
-
fromBytes
public static IteratorStateImpl fromBytes(io.netty.buffer.ByteBuf serializedState)
Deserializes theIteratorStateImplfrom its serialized form obtained from callinggetToken().- Parameters:
serializedState- A serializedIteratorStateImpl.- Returns:
- The IteratorState object.
-
fromBytes
public static IteratorStateImpl fromBytes(java.nio.ByteBuffer serializedState)
Deserializes the IteratorState from its serialized form obtained from callingtoBytes()()} .- Parameters:
serializedState- A serializedIteratorStateImpl.- Returns:
- The IteratorState object.
-
copyOf
public static IteratorStateImpl copyOf(IteratorState source)
Creates a newIteratorStateImplwhich is a copy of the givenIteratorState.- Parameters:
source- TheIteratorStateto copy.- Returns:
- The copy.
-
getToken
public io.netty.buffer.ByteBuf getToken()
-
-