@PublicApi public class JsonData extends Object
public JsonData(Object data)
public Object getData()
public boolean isNull()
public String asString()
public String asString(String fieldName, ErrorCollection errors)
public boolean isString()
public boolean isObject()
public boolean isArray()
public List<?> asArray()
public List<String> asArrayOfStrings(boolean allowNulls, String fieldName, ErrorCollection errors)
public List<String> asArrayOfObjectsWithId(String fieldName, ErrorCollection errors)
public String asObjectWithProperty(String propertyname, String fieldName, ErrorCollection errors)
public String asObjectWithProperty(String propertyname, String fieldName, boolean expected, ErrorCollection errors)
public List<String> asArrayOfObjectsWithProperty(String propertyname, String fieldName, ErrorCollection errors)
public Long getObjectLongProperty(String propertyname, ErrorCollection errors)
public Date getObjectDateProperty(String propertyname, ErrorCollection errors)
public String getObjectStringProperty(String propertyname, String fieldName, ErrorCollection errors)
public <T> T convertValue(String propertyname, Class<T> type, ErrorCollection errors)
public <T> T convertValue(String fieldId, TypeRef<T> type, ErrorCollection errors)
List<UserJsonBean> users = jsonData.convertValue("customfield_10000", new TypeRef<List<UserJsonBean>> {}, errors);
T
- the type that we want to deserialise intofieldId
- a String containing the field idtype
- a TypeRef used to capture the generic type information. this will generally be an anonymous classerrors
- an ErrorCollection to use for storing errorsCopyright © 2002-2015 Atlassian. All Rights Reserved.