/** * Create a new GoalStatus based on the given Message. Any missing values * will be set to their defaults. * * @param m * The Message to parse. * @return A GoalStatus message based on the given Message. */ public static GoalStatus fromMessage(Message m) { // get it from the JSON object return GoalStatus.fromJsonObject(m.toJsonObject()); }
/** * Create a new GoalStatus based on the given Message. Any missing values * will be set to their defaults. * * @param m * The Message to parse. * @return A GoalStatus message based on the given Message. */ public static GoalStatus fromMessage(Message m) { // get it from the JSON object return GoalStatus.fromJsonObject(m.toJsonObject()); }
@Override public void handleMessage(Message message) { JsonArray statusList = message.toJsonObject().getJsonArray("status_list"); statusList.forEach(status -> { String goalId = ((JsonObject)status).getJsonObject("goal_id").getString("id"); if (goals.containsKey(goalId)) { ActionCallback cb = goals.get(goalId); cb.handleStatus(GoalStatus.fromJsonObject((JsonObject)status)); } }); } });
@Override public void handleMessage(Message message) { String goalId = message.toJsonObject().getJsonObject("status").getJsonObject("goal_id").getString("id"); if (goals.containsKey(goalId)) { ActionCallback cb = goals.get(goalId); cb.handleStatus(GoalStatus.fromJsonObject(message.toJsonObject().getJsonObject("status"))); cb.handleFeedback(message.toJsonObject().getJsonObject("feedback")); } } });
@Override public void handleMessage(Message message) { String goalId = message.toJsonObject().getJsonObject("status").getJsonObject("goal_id").getString("id"); if (goals.containsKey(goalId)) { ActionCallback cb = goals.get(goalId); cb.handleStatus(GoalStatus.fromJsonObject(message.toJsonObject().getJsonObject("status"))); cb.handleResult(message.toJsonObject().getJsonObject("result")); } } });
statuses[i] = GoalStatus.fromJsonObject(jsonPoses .getJsonObject(i));
statuses[i] = GoalStatus.fromJsonObject(jsonPoses .getJsonObject(i));