Class JsonData
java.lang.Object
com.atlassian.jira.issue.fields.rest.json.JsonData
- Since:
- 5.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionList<?>
asArray()
asArrayOfObjectsWithId
(String fieldName, ErrorCollection errors) asArrayOfObjectsWithProperty
(String propertyname, String fieldName, ErrorCollection errors) asArrayOfStrings
(boolean allowNulls, String fieldName, ErrorCollection errors) asObject()
asObjectWithProperty
(String propertyname, String fieldName, boolean expected, ErrorCollection errors) asObjectWithProperty
(String propertyname, String fieldName, ErrorCollection errors) asString()
asString
(String fieldName, ErrorCollection errors) <T> T
convertValue
(String fieldId, TypeRef<T> type, ErrorCollection errors) Converts the value in this JsonData to a generic type.<T> T
convertValue
(String propertyname, Class<T> type, ErrorCollection errors) getData()
getObjectDateProperty
(String propertyname, ErrorCollection errors) getObjectLongProperty
(String propertyname, ErrorCollection errors) getObjectStringProperty
(String propertyname, String fieldName, ErrorCollection errors) boolean
isArray()
boolean
isNull()
boolean
isObject()
boolean
isString()
-
Constructor Details
-
JsonData
-
-
Method Details
-
getData
-
isNull
public boolean isNull() -
asString
-
asString
-
isString
public boolean isString() -
asObject
-
isObject
public boolean isObject() -
isArray
public boolean isArray() -
asArray
-
asArrayOfStrings
-
asArrayOfObjectsWithId
-
asObjectWithProperty
-
asObjectWithProperty
public String asObjectWithProperty(String propertyname, String fieldName, boolean expected, ErrorCollection errors) -
asArrayOfObjectsWithProperty
public List<String> asArrayOfObjectsWithProperty(String propertyname, String fieldName, ErrorCollection errors) -
getObjectLongProperty
-
getObjectDateProperty
-
getObjectStringProperty
public String getObjectStringProperty(String propertyname, String fieldName, ErrorCollection errors) -
convertValue
-
convertValue
Converts the value in this JsonData to a generic type. To get a list of UserJsonBean, for example, use:List<UserJsonBean> users = jsonData.convertValue("customfield_10000", new TypeRef<List<UserJsonBean>> {}, errors);
- Type Parameters:
T
- the type that we want to deserialise into- Parameters:
fieldId
- 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 errors- Returns:
- an instance of T, or null
-