Package io.deephaven.kv.common
Class KeyPathSimpleValue<T>
java.lang.Object
io.deephaven.kv.KeyPathContextBase
io.deephaven.kv.common.KeyPathSimpleValue<T>
- All Implemented Interfaces:
GetPrefixResponseParser<Optional<T>>,GetResponseParser<Optional<T>>,Context,KeyPathContext,KeyValuesCollectionParser<Optional<T>>
- Direct Known Subclasses:
EnumContext,InstantContext,KeyPathPrefixContext,ModContext,OptionalLongContext,RawValueContext,StringContext,UpdateCountContext
public abstract class KeyPathSimpleValue<T>
extends KeyPathContextBase
implements GetPrefixResponseParser<Optional<T>>, GetResponseParser<Optional<T>>
Provides a basic implementation of
GetPrefixResponseParser and GetResponseParser
given a KeyValueParser.
To satisfy the "no more state" requirement of KeyPathContext, the provided
KeyValueParser should be a singleton passed in directly from the implementation.
All implementations should be terminal Contexts (ie, have a description of
KeyPathContextDescription.terminal()).
-
Field Summary
Fields inherited from class io.deephaven.kv.KeyPathContextBase
context, description -
Constructor Summary
ConstructorsConstructorDescriptionKeyPathSimpleValue(KeyPath context, KeyValueParser<T> parser) Construct aKeyPathSimpleValueat a path with a parser. -
Method Summary
Modifier and TypeMethodDescriptionThe context where the parser will look for data in the responsebooleanisPresentIn(KeyValuesCollection response) parse(@NotNull KeyValuesCollection response) Parse the key values into an object.parseOrThrow(KeyValuesCollection response) Methods inherited from class io.deephaven.kv.KeyPathContextBase
equals, getDescription, getPath, hashCodeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.deephaven.kv.common.GetPrefixResponseParser
checkContext, getPrefix, parseMethods inherited from interface io.deephaven.kv.common.GetResponseParser
checkContext, parseMethods inherited from interface io.deephaven.kv.KeyPathContext
getDescription, getPath, resolve
-
Constructor Details
-
KeyPathSimpleValue
Construct aKeyPathSimpleValueat a path with a parser.- Parameters:
context- the key pathparser- the parser
-
-
Method Details
-
parse
Description copied from interface:KeyValuesCollectionParserParse the key values into an object.Implementations should throw appropriate exceptions if any assumed preconditions for the
keyPathCollectionare not met.- Specified by:
parsein interfaceKeyValuesCollectionParser<T>- Parameters:
response- the key values- Returns:
- the non-null parsed object
-
getContext
Description copied from interface:GetPrefixResponseParserThe context where the parser will look for data in the response- Specified by:
getContextin interfaceGetPrefixResponseParser<T>- Specified by:
getContextin interfaceGetResponseParser<T>
-
parseOrThrow
-
isPresentIn
-