Class QueryResponse.Builder<T>

  • Enclosing class:
    QueryResponse

    public static final class QueryResponse.Builder<T>
    extends java.lang.Object
    • Constructor Detail

      • Builder

        public Builder​(Codec<T> codec)
        Initializes a QueryResponse.Builder.
        Parameters:
        codec - The codec to use when building data.
    • Method Detail

      • lastSeenTxn

        public QueryResponse.Builder<T> lastSeenTxn​(java.lang.Long lastSeenTxn)
        Set the last seen transaction timestamp on the builder.
        Parameters:
        lastSeenTxn - The last seen transaction timestamp.
        Returns:
        This
      • schemaVersion

        public QueryResponse.Builder<T> schemaVersion​(java.lang.Long schemaVersion)
        Set the schema version on the builder.
        Parameters:
        schemaVersion - The schema version.
        Returns:
        This
      • data

        public QueryResponse.Builder<T> data​(com.fasterxml.jackson.core.JsonParser parser)
        Set the data on the builder by consuming the provided JsonParser with the configured codec.
        Parameters:
        parser - The JsonParser to consume.
        Returns:
        This
      • queryTags

        public QueryResponse.Builder<T> queryTags​(QueryTags tags)
        Set the query tags on the builder.
        Parameters:
        tags - The query tags to set.
        Returns:
        This
      • error

        public QueryResponse.Builder<T> error​(ErrorInfo info)
        Sets the error info on the builder.
        Parameters:
        info - The error info to set.
        Returns:
        This
      • staticType

        public QueryResponse.Builder<T> staticType​(java.lang.String staticType)
        Sets the static type on the builder.
        Parameters:
        staticType - The static type to set.
        Returns:
        This
      • summary

        public QueryResponse.Builder<T> summary​(java.lang.String summary)
        Sets the summary on the builder.
        Parameters:
        summary - The summary to set.
        Returns:
        This
      • stats

        public QueryResponse.Builder<T> stats​(QueryStats stats)
        Sets the query stats on the builder.
        Parameters:
        stats - The query stats to set.
        Returns:
        This
      • buildSuccess

        public QuerySuccess<T> buildSuccess()
        Builds a QuerySuccess.
        Returns:
        A QuerySuccess from the current builder.
      • getStaticType

        public java.lang.String getStaticType()
        Gets a string representing the static type.
        Returns:
        A string representing the static type.
      • getError

        public ErrorInfo getError()
        Gets an ErrorInfo instance representing an error on the response.
        Returns:
        An ErrorInfo instance.
      • getData

        public T getData()
        Gets the parsed data from the response.
        Returns:
        The parsed data.