public class HBaseJSONUtil
extends java.lang.Object
Constructor and Description |
---|
HBaseJSONUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
appendToJSONArrayProperty(java.lang.String ticket,
org.json.JSONObject jsonToAppend,
java.lang.String objectId,
java.lang.String columnFamily,
java.lang.String qualifier)
Appends the JSONObject passed in onto the existing JSON in the property and saves it to the repo.
|
static org.json.JSONArray |
convertBytesToJSONArray(byte[] bytes)
Helper method to convert the bytes to JSON.
|
static org.json.JSONArray |
getJSONArrayProperty(java.lang.String objectId,
java.lang.String columnFamily,
java.lang.String qualifier)
Parse the value of the requested field from HBase into an HBase array and return the result
|
static void |
setJSONArrayProperty(java.lang.String ticket,
org.json.JSONArray json,
java.lang.String objectId,
java.lang.String columnFamily,
java.lang.String qualifier)
Sets the json array passed in as the value of the requested attribute in HBase.
|
public static void appendToJSONArrayProperty(java.lang.String ticket, org.json.JSONObject jsonToAppend, java.lang.String objectId, java.lang.String columnFamily, java.lang.String qualifier)
ticket
- jsonToAppend
- objectId
- columnFamily
- qualifier
- public static void setJSONArrayProperty(java.lang.String ticket, org.json.JSONArray json, java.lang.String objectId, java.lang.String columnFamily, java.lang.String qualifier)
appendToJSONArrayProperty(String, JSONObject, String, String, String)
if you want to just append an item to the existing value as
a new item in the JSON array.ticket
- json
- JSON to put in the attribute valueobjectId
- columnFamily
- cf that the attribute belongs toqualifier
- the attribute name to put the JSON intopublic static org.json.JSONArray getJSONArrayProperty(java.lang.String objectId, java.lang.String columnFamily, java.lang.String qualifier)
objectId
- columnFamily
- qualifier
- public static org.json.JSONArray convertBytesToJSONArray(byte[] bytes) throws org.json.JSONException
bytes
- org.json.JSONException