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

io.github.thunderz99.cosmos.CosmosDocument Maven / Gradle / Ivy

There is a newer version: 0.7.11
Show newest version
package io.github.thunderz99.cosmos;

import java.util.Map;

import io.github.thunderz99.cosmos.util.JsonUtil;

/**
 * Represent a CosmosDB document. Has a JSONObject inside.
 * 

* Having toObject and toJson util method to convert to Class or String * conveniently. */ public class CosmosDocument { /** * used for sdk v4 */ Map mapObj; public CosmosDocument(Map mapObj) { this.mapObj = mapObj; } public T toObject(Class classOfT) { return mapObj == null ? null : JsonUtil.fromMap(mapObj, classOfT); } public String toJson() { return mapObj == null ? null : JsonUtil.toJson(mapObj); } public Map toMap() { return mapObj == null ? null : mapObj; } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy