@Override public String toString() { return getToStringHelper().toString(); }
@Nullable private JsonObjectParser<Object> getParserFor(FieldSchema fieldSchema) throws JSONException { final Set<String> customFieldsTypesWithFieldOption = ImmutableSet.of( "com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes", "com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons", "com.atlassian.jira.plugin.system.customfieldtypes:select", "com.atlassian.jira.plugin.system.customfieldtypes:cascadingselect", "com.atlassian.jira.plugin.system.customfieldtypes:multiselect" ); String type = "array".equals(fieldSchema.getType()) ? fieldSchema.getItems() : fieldSchema.getType(); final String custom = fieldSchema.getCustom(); if (custom != null && customFieldsTypesWithFieldOption.contains(custom)) { type = "customFieldOption"; } @SuppressWarnings("unchecked") final JsonObjectParser<Object> jsonParser = registeredAllowedValueParsers.get(type); if (jsonParser == null) { return null; } else { return jsonParser; } } }
@Override public boolean matches(FieldSchema schema) { return "project".equals(schema.getType()); }
@Override public FieldSchema parse(JSONObject json) throws JSONException { final String type = JsonParseUtil.getOptionalString(json, "type"); final String items = JsonParseUtil.getOptionalString(json, "items"); final String system = JsonParseUtil.getOptionalString(json, "system"); final String custom = JsonParseUtil.getOptionalString(json, "custom"); final Long customId = JsonParseUtil.getOptionalLong(json, "customId"); return new FieldSchema(type, items, system, custom, customId); } }
private static boolean isCustom(CimFieldInfo info) { return info != null && info.getSchema() != null && info.getSchema().getCustomId() != null; } }
@Nullable private JsonObjectParser<Object> getParserFor(FieldSchema fieldSchema) throws JSONException { final Set<String> customFieldsTypesWithFieldOption = ImmutableSet.of( "com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes", "com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons", "com.atlassian.jira.plugin.system.customfieldtypes:select", "com.atlassian.jira.plugin.system.customfieldtypes:cascadingselect", "com.atlassian.jira.plugin.system.customfieldtypes:multiselect" ); String type = "array".equals(fieldSchema.getType()) ? fieldSchema.getItems() : fieldSchema.getType(); final String custom = fieldSchema.getCustom(); if (custom != null && customFieldsTypesWithFieldOption.contains(custom)) { type = "customFieldOption"; } @SuppressWarnings("unchecked") final JsonObjectParser<Object> jsonParser = registeredAllowedValueParsers.get(type); if (jsonParser == null) { return null; } else { return jsonParser; } } }
@Override public boolean matches(FieldSchema schema) { return "project".equals(schema.getType()); }
@Override public FieldSchema parse(JSONObject json) throws JSONException { final String type = JsonParseUtil.getOptionalString(json, "type"); final String items = JsonParseUtil.getOptionalString(json, "items"); final String system = JsonParseUtil.getOptionalString(json, "system"); final String custom = JsonParseUtil.getOptionalString(json, "custom"); final Long customId = JsonParseUtil.getOptionalLong(json, "customId"); return new FieldSchema(type, items, system, custom, customId); } }
private static boolean isCustom(CimFieldInfo info) { return info != null && info.getSchema() != null && info.getSchema().getCustomId() != null; } }
JSONArray valuesToParse; final boolean isProjectCF = "project".equals(fieldSchema.getType()) && "com.atlassian.jira.plugin.system.customfieldtypes:project".equals(fieldSchema.getCustom()); final boolean isVersionCF = "version".equals(fieldSchema.getType()) && "com.atlassian.jira.plugin.system.customfieldtypes:version".equals(fieldSchema.getCustom()); final boolean isMultiVersionCF = "array".equals(fieldSchema.getType()) && "version".equals(fieldSchema.getItems()) && "com.atlassian.jira.plugin.system.customfieldtypes:multiversion".equals(fieldSchema.getCustom());