org.apache.oozie.client.rest
Class JsonUtils

java.lang.Object
  extended by org.apache.oozie.client.rest.JsonUtils

public class JsonUtils
extends java.lang.Object

Json utils methods.


Constructor Summary
JsonUtils()
           
 
Method Summary
static java.lang.String formatDateRfc822(java.util.Date date)
          Format a Date in RFC822 GMT.
static java.util.List<java.lang.String> getListString(org.json.simple.JSONObject json, java.lang.String name)
          Return a List value from a JSONObject.
static long getLongValue(org.json.simple.JSONObject map, java.lang.String name)
          Return a long value from a JSONObject.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JsonUtils

public JsonUtils()
Method Detail

formatDateRfc822

public static java.lang.String formatDateRfc822(java.util.Date date)
Format a Date in RFC822 GMT.

Parameters:
date - date to format.
Returns:
RFC822 GMT for the date, null if the date was null.

getLongValue

public static long getLongValue(org.json.simple.JSONObject map,
                                java.lang.String name)
Return a long value from a JSONObject.

Parameters:
map - JSON object.
name - name of the property.
Returns:
the long value associated with it, or 0 if not defined.

getListString

public static java.util.List<java.lang.String> getListString(org.json.simple.JSONObject json,
                                                             java.lang.String name)
Return a List value from a JSONObject.

Parameters:
map - JSON object.
name - name of the property.
Returns:
the List value associated with it, or null if not defined.


Copyright © 2010 Yahoo. All Rights Reserved.