All Downloads are FREE. Search and download functionalities are using the official Maven repository.

apoc.couchbase.document.CouchbaseJsonDocument Maven / Gradle / Ivy

package apoc.couchbase.document;

import com.couchbase.client.core.msg.kv.MutationToken;
import com.couchbase.client.java.json.JsonObject;
import com.couchbase.client.java.kv.GetResult;
import com.couchbase.client.java.kv.MutationResult;

import java.util.Map;

/**
 * Represents a {@link MutationResult} or a {@link GetResult} (in case of apoc.couchbase.get procedure)
 * that contains a JSON object as the
 * content.
 * 

* The JSON object here comes in the form of a Map. * * @see JsonObject */ public class CouchbaseJsonDocument extends CouchbaseObjectDocument> { /** * The json content of the {@link GetResult}. */ public Map content; public CouchbaseJsonDocument(GetResult getResult, String id) { this(getResult, id, null); } public CouchbaseJsonDocument(GetResult getResult, String id, MutationToken mutationToken) { super(getResult, id, mutationToken); this.content = getResult.contentAsObject().toMap(); } @Override public Map getContent() { return this.content; } @Override public String toString() { return "CouchbaseJsonDocument {" + "content=" + content + ", id='" + id + '\'' + ", expiry=" + expiry + ", cas=" + cas + ", mutationToken=" + mutationToken + '}'; } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy