Class GetResult


  • public class GetResult
    extends Object
    Returned from all kinds of KeyValue Get operation to fetch a document or a subset of it.
    Since:
    3.0.0
    • Method Detail

      • cas

        public long cas()
        Returns the CAS value of the loaded document.
      • expiration

        public Optional<Duration> expiration()
        If present, returns the expiration of the loaded document.

        Note that the duration represents the time when the document has been loaded and can only ever be an approximation.

      • contentAsObject

        public JsonObject contentAsObject()
        Decodes the content of the document into a JsonObject.
      • contentAsArray

        public JsonArray contentAsArray()
        Decodes the content of the document into a JsonArray.
      • contentAs

        public <T> T contentAs​(Class<T> target)
        Decodes the content of the document into a the target class using the default decoder.

        Note that while the decoder understands many types, if it fails to decode a certain POJO or custom decoding is needed use the contentAs(Class, Decoder) overload.

        Parameters:
        target - the target class to decode the encoded content into.
      • contentAs

        public <T> T contentAs​(Class<T> target,
                               Decoder<T> decoder)
        Decodes the content of the document into a the target class using a custom decoder.
        Parameters:
        target - the target class to decode the encoded content into.
        decoder - the decoder that should be used to decode the content.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object