Package io.deephaven.kv
Class WatchResponseUnit
java.lang.Object
io.deephaven.kv.WatchResponseUnit
An immutable unit response derived from a
WatchResponse. Presents a simpler data model
that listeners can consume without needing to deal with the boundaries between modification
revisions in a WatchResponse.-
Method Summary
Modifier and TypeMethodDescriptionbooleanThe watchresponse header.longGuaranteed to be less-than-or-equal-togetHeader().getRevision().Get the collection of Keys and values that have been removed in this unit.Get the collection of Keys and values that have been updated or added in this unit.inthashCode()booleanA unit is the last unit ifgetModificationRevision()is equal to the largest modification revision in theWatchResponse.static @NotNull List<WatchResponseUnit>parse(@NotNull WatchResponse response) Converts awatch responseinto a list ofwatch response units.
-
Method Details
-
parse
@NotNull public static @NotNull List<WatchResponseUnit> parse(@NotNull @NotNull WatchResponse response) Converts awatch responseinto a list ofwatch response units.The list will be ordered by
getModificationRevision().- Parameters:
response- the watch response- Returns:
- the list of watch response units
-
getHeader
The watchresponse header.- Returns:
- the header
-
getUpdated
Get the collection of Keys and values that have been updated or added in this unit. Allkey valueswill have theirmod revequal togetModificationRevision().There will be no overlapping keys with respect to
getRemoved().There will be at least one item between
getRemoved()and the returned values.- Returns:
- the updated key values
-
getRemoved
Get the collection of Keys and values that have been removed in this unit. Allkey valueswill have theirmod revequal togetModificationRevision().There will be no overlapping keys with respect to
getUpdated().There will be at least one item between
getUpdated()and the returned values.- Returns:
- the removed key values
-
getModificationRevision
public long getModificationRevision()Guaranteed to be less-than-or-equal-togetHeader().getRevision().- Returns:
- the modification revision
-
isLastUnit
public boolean isLastUnit()A unit is the last unit ifgetModificationRevision()is equal to the largest modification revision in theWatchResponse.- Returns:
- true iff this unit is the last unit in the
WatchResponse
-
equals
-
hashCode
public int hashCode()
-