Class KeyValueEntry
-
- All Implemented Interfaces:
public final class KeyValueEntry<T extends Object>Represents an entry in the Key-Value store with typed payload
-
-
Constructor Summary
Constructors Constructor Description KeyValueEntry(String bucket, String key, T value, KeyValueOperation operation, Long revision, Instant created, Long delta)
-
Method Summary
Modifier and Type Method Description final StringgetBucket()The name of the bucket containing this entry final StringgetKey()The key for this entry final TgetValue()The typed value. final KeyValueOperationgetOperation()The operation type (PUT, DELETE, PURGE) final LonggetRevision()The revision number of this entry final InstantgetCreated()The timestamp when this entry was created final LonggetDelta()The number of entries pending after this one (0 means this is the latest) final BooleanisLatest()Check if this entry is the latest for the key final BooleanisDelete()Check if this is a DELETE operation final BooleanisPurge()Check if this is a PURGE operation final BooleanisPut()Check if this is a PUT operation -
-
Method Detail
-
getValue
final T getValue()
The typed value. It is
nullfor a DELETE or PURGE, and for every entry of a KvWatchOption.META_ONLY watch, which asks the server for headers alone. A live PUT whose payload is empty is a value, the same one eu.vstoyanov.natsy.jetstream.KeyValueStore.get returns. A value that could not be decoded never reaches here: the watch'sDecodeErrorStrategydecides its fate.
-
getOperation
final KeyValueOperation getOperation()
The operation type (PUT, DELETE, PURGE)
-
getRevision
final Long getRevision()
The revision number of this entry
-
getCreated
final Instant getCreated()
The timestamp when this entry was created
-
getDelta
final Long getDelta()
The number of entries pending after this one (0 means this is the latest)
-
-
-
-