Skip to content

Commit

Permalink
Remove ReplyTarget.fromJsonOptional.
Browse files Browse the repository at this point in the history
Signed-off-by: Yufei Cai <yufei.cai@bosch-si.com>
  • Loading branch information
yufei-cai committed Nov 15, 2019
1 parent e8460f0 commit 83350f4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,9 @@ public static Source fromJson(final JsonObject jsonObject, final int index) {
jsonObject.getValue(JsonFields.REPLY_TARGET_ENABLED).orElse(DEFAULT_REPLY_TARGET_ENABLED);

final ReplyTarget readReplyTarget =
jsonObject.getValue(JsonFields.REPLY_TARGET).flatMap(ReplyTarget::fromJsonOptional).orElse(null);
jsonObject.getValue(JsonFields.REPLY_TARGET)
.flatMap(ImmutableReplyTarget::fromJsonOptional)
.orElse(null);

return new Builder()
.addresses(readSources)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,19 +74,6 @@ static ReplyTarget fromJson(final JsonObject jsonObject) {
return ImmutableReplyTarget.fromJson(jsonObject);
}

/**
* Creates a new reply-target object from the specified JSON object, or return an empty optional if it cannot be
* read.
*
* @param jsonObject a JSON object which provides the data for the reply-target to be created.
* @return a new reply-target which is initialised with the extracted data from {@code jsonObject}.
* @throws NullPointerException if {@code jsonObject} is {@code null}.
* @throws org.eclipse.ditto.json.JsonParseException if {@code jsonObject} is not an appropriate JSON object.
*/
static Optional<ReplyTarget> fromJsonOptional(final JsonObject jsonObject) {
return ImmutableReplyTarget.fromJsonOptional(jsonObject);
}

/**
* Create a new builder for a reply-target.
*
Expand Down

0 comments on commit 83350f4

Please sign in to comment.