com.aerospike.documentapi.Utils 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;
import com.aerospike.client.Bin;
import com.fasterxml.jackson.databind.JsonNode;
public class Utils {
public static Bin createBinByJsonNodeType(String binName, JsonNode jsonNode) {
if (jsonNode.isArray()) {
return new Bin(binName, JsonConverters.convertJsonNodeToList(jsonNode));
} else {
return new Bin(binName, JsonConverters.convertJsonNodeToMap(jsonNode));
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy