private Deprecation parseDeprecation(JSONObject object) throws Exception { if (object.has("deprecation")) { JSONObject deprecationJsonObject = object.getJSONObject("deprecation"); Deprecation deprecation = new Deprecation(); deprecation.setLevel(parseDeprecationLevel( deprecationJsonObject.optString("level", null))); String reason = deprecationJsonObject.optString("reason", null); deprecation.setReason(reason); deprecation.setShortReason(this.sentenceExtractor.getFirstSentence(reason)); deprecation .setReplacement(deprecationJsonObject.optString("replacement", null)); return deprecation; } return object.optBoolean("deprecated") ? new Deprecation() : null; }