@Test public void getAsString_keyDoesNotExists_returnsNull() { assertThat(cut.getAsString("keyDoesNotExist")).isNull(); }
@Override @Nullable public String getAsString(String name) { if (contains(name)) { try { return getJsonObject().getString(name); } catch (JSONException e) { throw new JsonParsingException(e.getMessage()); } } return null; }
DefaultJsonObject implements JsonObject { @Override @Nullable public String getAsString(String name) { if (contains(name)) { try { return getJsonObject().getString(name); } catch (JSONException e) { throw new JsonParsingException(e.getMessage()); } } return null; } }
DefaultJsonObject implements JsonObject { @Override @Nullable public String getAsString(String name) { if (contains(name)) { try { return getJsonObject().getString(name); } catch (JSONException e) { throw new JsonParsingException(e.getMessage()); } } return null; } DefaultJsonObject(String jsonString); }
DefaultJsonObject implements JsonObject { @Override @Nullable public String getAsString(String name) { if (contains(name)) { try { return getJsonObject().getString(name); } catch (JSONException e) { throw new JsonParsingException(e.getMessage()); } } return null; } DefaultJsonObject(String jsonString); @Override boolean contains(String key); @Override boolean isEmpty(); @Override List<T> getAsList(String name, Class<T> type); @Override List<String> getAsStringList(String name); @Override @Nullable String getAsString(String name); @Override @Nullable Instant getAsInstant(String name); @Nullable @Override Long getAsLong(String name); @Override @Nullable JsonObject getJsonObject(String name); @Override List<JsonObject> getJsonObjects(String name); @Override Map<String, String> getKeyValueMap(); @Override String asJsonString(); @Override String toString(); }
DefaultJsonObject implements JsonObject { @Override @Nullable public String getAsString(String name) { if (contains(name)) { try { return getJsonObject().getString(name); } catch (JSONException e) { throw new JsonParsingException(e.getMessage()); } } return null; } DefaultJsonObject(String jsonString); @Override boolean contains(String key); @Override boolean isEmpty(); @Override List<T> getAsList(String name, Class<T> type); @Override List<String> getAsStringList(String name); @Override @Nullable String getAsString(String name); @Override @Nullable Instant getAsInstant(String name); @Nullable @Override Long getAsLong(String name); @Override @Nullable JsonObject getJsonObject(String name); @Override List<JsonObject> getJsonObjects(String name); @Override Map<String, String> getKeyValueMap(); @Override String asJsonString(); @Override String toString();  }