1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package com.atlassian.jira.rest.client.internal.json;
18
19 import com.atlassian.jira.rest.client.api.domain.FieldSchema;
20 import org.codehaus.jettison.json.JSONException;
21 import org.codehaus.jettison.json.JSONObject;
22
23
24
25
26
27
28 public class FieldSchemaJsonParser implements JsonObjectParser<FieldSchema> {
29
30 @Override
31 public FieldSchema parse(JSONObject json) throws JSONException {
32 final String type = JsonParseUtil.getOptionalString(json, "type");
33 final String items = JsonParseUtil.getOptionalString(json, "items");
34 final String system = JsonParseUtil.getOptionalString(json, "system");
35 final String custom = JsonParseUtil.getOptionalString(json, "custom");
36 final Long customId = JsonParseUtil.getOptionalLong(json, "customId");
37
38 return new FieldSchema(type, items, system, custom, customId);
39 }
40 }