java.lang.Object
com.atlassian.jira.issue.fields.rest.json.JsonData

@PublicApi public class JsonData extends Object
Since:
5.0
  • Constructor Details

    • JsonData

      public JsonData(Object data)
  • Method Details

    • getData

      public Object getData()
    • isNull

      public boolean isNull()
    • asString

      public String asString()
    • asString

      public String asString(String fieldName, ErrorCollection errors)
    • isString

      public boolean isString()
    • asObject

      public Map<String,Object> asObject()
    • isObject

      public boolean isObject()
    • isArray

      public boolean isArray()
    • asArray

      public List<?> asArray()
    • asArrayOfStrings

      public List<String> asArrayOfStrings(boolean allowNulls, String fieldName, ErrorCollection errors)
    • asArrayOfObjectsWithId

      public List<String> asArrayOfObjectsWithId(String fieldName, ErrorCollection errors)
    • asObjectWithProperty

      public String asObjectWithProperty(String propertyname, String fieldName, ErrorCollection errors)
    • asObjectWithProperty

      public String asObjectWithProperty(String propertyname, String fieldName, boolean expected, ErrorCollection errors)
    • asArrayOfObjectsWithProperty

      public List<String> asArrayOfObjectsWithProperty(String propertyname, String fieldName, ErrorCollection errors)
    • getObjectLongProperty

      public Long getObjectLongProperty(String propertyname, ErrorCollection errors)
    • getObjectDateProperty

      public Date getObjectDateProperty(String propertyname, ErrorCollection errors)
    • getObjectStringProperty

      public String getObjectStringProperty(String propertyname, String fieldName, ErrorCollection errors)
    • convertValue

      public <T> T convertValue(String propertyname, Class<T> type, ErrorCollection errors)
    • convertValue

      public <T> T convertValue(String fieldId, TypeRef<T> type, ErrorCollection errors)
      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 id
      type - a TypeRef used to capture the generic type information. this will generally be an anonymous class
      errors - an ErrorCollection to use for storing errors
      Returns:
      an instance of T, or null