org.sonar.wsclient
Class JdkUtils
java.lang.Object
org.sonar.wsclient.services.WSUtils
org.sonar.wsclient.JdkUtils
public final class JdkUtils
- extends WSUtils
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JdkUtils
public JdkUtils()
format
public String format(Date date,
String format)
- Specified by:
format
in class WSUtils
encodeUrl
public String encodeUrl(String url)
- Specified by:
encodeUrl
in class WSUtils
getField
public Object getField(Object json,
String field)
- Specified by:
getField
in class WSUtils
- Returns:
- value of specified field from specified JSON object,
or
null
if field does not exist
getString
@CheckForNull
public String getString(Object json,
String field)
- Specified by:
getString
in class WSUtils
- Returns:
- value of a string field from specified JSON object,
or string representation of a numeric field,
or
null
if field does not exist
getBoolean
@CheckForNull
public Boolean getBoolean(Object json,
String field)
- Specified by:
getBoolean
in class WSUtils
- Returns:
- Boolean value of specified field from specified JSON object,
or
null
if field does not exist
getInteger
@CheckForNull
public Integer getInteger(Object json,
String field)
- Specified by:
getInteger
in class WSUtils
- Returns:
- Integer value of specified field from specified JSON object,
or
null
if field does not exist
getDouble
@CheckForNull
public Double getDouble(Object json,
String field)
- Specified by:
getDouble
in class WSUtils
- Returns:
- Double value of specified field from specified JSON object,
or
null
if field does not exist
getLong
@CheckForNull
public Long getLong(Object json,
String field)
- Specified by:
getLong
in class WSUtils
- Returns:
- Long value of specified field from specified JSON object,
or
null
if field does not exist
getDateTime
@CheckForNull
public Date getDateTime(Object json,
String field)
- Specified by:
getDateTime
in class WSUtils
- Returns:
- Date value of specified field from specified JSON object,
or
null
if field does not exist
getArraySize
public int getArraySize(Object array)
- Specified by:
getArraySize
in class WSUtils
- Returns:
- size of specified JSON array
getArrayElement
public Object getArrayElement(Object array,
int i)
- Specified by:
getArrayElement
in class WSUtils
- Returns:
- element from specified JSON array
parse
public Object parse(String jsonStr)
- Specified by:
parse
in class WSUtils
- Returns:
- JSON object
getFields
public Set<String> getFields(Object json)
- Specified by:
getFields
in class WSUtils
- Returns:
- field names in specified JSON object
Copyright © 2009-2013 SonarSource. All Rights Reserved.