Package io.deephaven.kv.common
Interface GetPrefixResponseParser<X>
- Type Parameters:
X- the type to parse
- All Superinterfaces:
KeyValuesCollectionParser<X>
- All Known Implementing Classes:
EnumContext,FileContext.File,FilesContext.FileIdentifiers,FilesContext.Files,InstantContext,KeyPathPrefixContext,KeyPathSimpleValue,MetaInfoContext.Meta,ModContext,OptionalLongContext,PersistentQueriesContext.PQs,PersistentQueryContext.PQ,RawValueContext,RoutingFileContext,SchemaContext.NamespaceNames,SchemaContext.Namespaces,SchemaNamespaceAttributesContext,SchemaNamespaceContext.Tables,SchemaNamespaceTablesContext.TableContents,SchemaNamespaceTablesContext.TableNames,SchemaTableContext.SchemaTableParser,StringContext,UpdateCountContext,UpdateInfoContext
An interface for parsing
GetPrefixResponses.
Essentially, presents a stronger parsing interface around KeyValuesCollectionParser.
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidcheckContext(GetPrefixResponse response) Ensures that the context is at least as specific as the response.The context where the parser will look for data in the responsedefault KeyPathEquivalent togetContext().getPath().default Xparse(GetPrefixResponse response) The response's request prefix must be less specific than, or equal to our context's path.Methods inherited from interface io.deephaven.kv.KeyValuesCollectionParser
parse
-
Method Details
-
parse
The response's request prefix must be less specific than, or equal to our context's path.For example, if this parser has the context "/a/b/c", then an acceptable get prefix request would be "/*", "/a/*", "/a/b/*", or "/a/b/c/*; and not "/x/*", nor "/a/b/c/d/*".
Implementations should call
checkContext(GetPrefixResponse)- Parameters:
response- the get prefix response- Returns:
- the parsed value
-
getContext
KeyPathContext getContext()The context where the parser will look for data in the response -
getPrefix
Equivalent togetContext().getPath().- Returns:
- the key path prefix
-
checkContext
Ensures that the context is at least as specific as the response. Otherwise, there is no way that the context can appropriately parse the response.- Parameters:
response- the response- Throws:
IllegalArgumentException- if the context is not at least as specific as the response
-