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

public interface GetPrefixResponseParser<X> extends KeyValuesCollectionParser<X>
An interface for parsing GetPrefixResponses.

Essentially, presents a stronger parsing interface around KeyValuesCollectionParser.

  • Method Details

    • parse

      default X parse(GetPrefixResponse response)
      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

      default KeyPath getPrefix()
      Equivalent to getContext().getPath().
      Returns:
      the key path prefix
    • checkContext

      default void checkContext(GetPrefixResponse response)
      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