
com.aerospike.documentapi.pathparts.PathPart Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of aerospike-document-api Show documentation
Show all versions of aerospike-document-api Show documentation
This project provides an API which allows Aerospike CDT (Collection Data Type) objects to be accessed and mutated using JSON like syntax.
Effectively this provides what can be termed a document API as CDT objects can be used to represent JSON in the Aerospike database.
package com.aerospike.documentapi.pathparts;
import com.aerospike.client.Operation;
import com.aerospike.client.Value;
import com.aerospike.client.cdt.CTX;
import com.aerospike.client.cdt.ListOperation;
/**
* AccessPathPart analysis is ultimately used to create CTX (context) objects and operations
*/
public abstract class PathPart {
public abstract CTX toAerospikeContext();
public abstract Operation toAerospikeGetOperation(String binName, CTX[] contexts);
public abstract Operation toAerospikePutOperation(String binName, Object object, CTX[] contexts);
public Operation toAerospikeAppendOperation(String binName, Object object, CTX[] contexts) {
return ListOperation.append(binName, Value.get(object), contexts);
}
public abstract Operation toAerospikeDeleteOperation(String binName, CTX[] contexts);
public abstract PathPartTypeEnum getType();
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy