@Override public Collection<BasicProjectRole> parse(@Nullable final JSONObject json) throws JSONException { return json == null ? ImmutableSet.<BasicProjectRole>of() : ImmutableSet.copyOf(Iterators.transform( JsonParseUtil.getStringKeys(json), new Function<String, BasicProjectRole>() { @Override public BasicProjectRole apply(@Nullable final String key) { try { return new BasicProjectRole(JsonParseUtil.parseURI(json.getString(key)), key); } catch (JSONException e) { throw new RestClientException(e); } } } )); }
private Map<String, String> parseNames(JSONObject json) throws JSONException { final HashMap<String, String> res = Maps.newHashMap(); final Iterator<String> iterator = getStringKeys(json); while (iterator.hasNext()) { final String key = iterator.next(); res.put(key, json.getString(key)); } return res; }
private Map<String, String> parseNames(JSONObject json) throws JSONException { final HashMap<String, String> res = Maps.newHashMap(); final Iterator<String> iterator = getStringKeys(json); while (iterator.hasNext()) { final String key = iterator.next(); res.put(key, json.getString(key)); } return res; }
@Override public Collection<BasicProjectRole> parse(@Nullable final JSONObject json) throws JSONException { return json == null ? ImmutableSet.<BasicProjectRole>of() : ImmutableSet.copyOf(Iterators.transform( JsonParseUtil.getStringKeys(json), new Function<String, BasicProjectRole>() { @Override public BasicProjectRole apply(@Nullable final String key) { try { return new BasicProjectRole(JsonParseUtil.parseURI(json.getString(key)), key); } catch (JSONException e) { throw new RestClientException(e); } } } )); }
private Map<String, String> parseNames(final JSONObject json) throws JSONException { final HashMap<String, String> res = Maps.newHashMap(); final Iterator<String> iterator = getStringKeys(json); while (iterator.hasNext()) { final String key = iterator.next(); res.put(key, json.getString(key)); } return res; }
@Override public Collection<BasicProjectRole> parse(@Nullable final JSONObject json) throws JSONException { return json == null ? ImmutableSet.<BasicProjectRole>of() : ImmutableSet.copyOf(Iterators.transform( JsonParseUtil.getStringKeys(json), new Function<String, BasicProjectRole>() { @Override public BasicProjectRole apply(@Nullable final String key) { try { return new BasicProjectRole(JsonParseUtil.parseURI(json.getString(key)), key); } catch (JSONException e) { throw new RestClientException(e); } } } )); }
private Map<String, String> parseNames(final JSONObject json) throws JSONException { final HashMap<String, String> res = Maps.newHashMap(); final Iterator<String> iterator = getStringKeys(json); while (iterator.hasNext()) { final String key = iterator.next(); res.put(key, json.getString(key)); } return res; }
private Map<String, String> parseSchema(JSONObject json) throws JSONException { final HashMap<String, String> res = Maps.newHashMap(); final Iterator<String> it = getStringKeys(json); while (it.hasNext()) { final String fieldId = it.next(); JSONObject fieldDefinition = json.getJSONObject(fieldId); res.put(fieldId, fieldDefinition.getString("type")); } return res; }
private Map<String, String> parseSchema(final JSONObject json) throws JSONException { final HashMap<String, String> res = Maps.newHashMap(); final Iterator<String> it = JsonParseUtil.getStringKeys(json); while (it.hasNext()) { final String fieldId = it.next(); JSONObject fieldDefinition = json.getJSONObject(fieldId); res.put(fieldId, fieldDefinition.getString("type")); } return res; }
private Map<String, String> parseSchema(final JSONObject json) throws JSONException { final HashMap<String, String> res = Maps.newHashMap(); final Iterator<String> it = JsonParseUtil.getStringKeys(json); while (it.hasNext()) { final String fieldId = it.next(); JSONObject fieldDefinition = json.getJSONObject(fieldId); res.put(fieldId, fieldDefinition.getString("type")); } return res; }
private Map<String, String> parseSchema(JSONObject json) throws JSONException { final HashMap<String, String> res = Maps.newHashMap(); final Iterator<String> it = getStringKeys(json); while (it.hasNext()) { final String fieldId = it.next(); JSONObject fieldDefinition = json.getJSONObject(fieldId); res.put(fieldId, fieldDefinition.getString("type")); } return res; }
private Collection<Field> parseFields(JSONObject json) throws JSONException { ArrayList<Field> res = new ArrayList<Field>(json.length()); final Iterator<String> iterator = getStringKeys(json); while (iterator.hasNext()) { final String key = iterator.next(); if (SPECIAL_FIELDS.contains(key)) { continue; } res.add(fieldParser.parse(json.getJSONObject(key), key)); } return res; }
private Collection<Field> parseFields(JSONObject json) throws JSONException { ArrayList<Field> res = new ArrayList<Field>(json.length()); final Iterator<String> iterator = getStringKeys(json); while (iterator.hasNext()) { final String key = iterator.next(); if (SPECIAL_FIELDS.contains(key)) { continue; } res.add(fieldParser.parse(json.getJSONObject(key), key)); } return res; }