org.apache.oozie.client.rest
Class JsonUtils

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

public class JsonUtils
extends Object

Json utils methods.


Constructor Summary
JsonUtils()
           
 
Method Summary
static String formatDateRfc822(Date date)
          Format a Date in RFC822 GMT.
static List<String> getListString(org.json.simple.JSONObject json, String name)
          Return a List value from a JSONObject.
static long getLongValue(org.json.simple.JSONObject map, 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 String formatDateRfc822(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,
                                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 List<String> getListString(org.json.simple.JSONObject json,
                                         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 © 2011 Yahoo. All Rights Reserved.