/** * Create a clone of this GoalID. */ @Override public GoalID clone() { return new GoalID(this.stamp, this.id); }
/** * Create a new empty GoalStatus. */ public GoalStatus() { this(new GoalID(), (byte) 0, ""); }
/** * Create a clone of this GoalID. * * @return the goal ID */ @Override public GoalID clone() { return new GoalID(this.stamp, this.id); }
/** * Create a new empty GoalStatus. */ public GoalStatus() { this(new GoalID(), (byte) 0, ""); }
Goal(ActionClient client) { this.client = client; this.id = "goal_" + Math.random() + "_" + new Date().getTime(); this.goalId = new GoalID(Time.now(), id); }
public void cancelAll() { GoalID msg = new GoalID(); cancelTopic.publish(msg); }
/** * Create a new GoalID based on the given JSON object. Any missing values * will be set to their defaults. * * @param jsonObject * The JSON object to parse. * @return A GoalID message based on the given JSON object. */ public static GoalID fromJsonObject(JsonObject jsonObject) { // check the fields Time stamp = jsonObject.containsKey(GoalID.FIELD_STAMP) ? Time .fromJsonObject(jsonObject.getJsonObject(GoalID.FIELD_STAMP)) : new Time(); String id = jsonObject.containsKey(GoalID.FIELD_ID) ? jsonObject .getString(GoalID.FIELD_ID) : ""; return new GoalID(stamp, id); } }
/** * Create a new GoalID based on the given JSON object. Any missing values * will be set to their defaults. * * @param jsonObject * The JSON object to parse. * @return A GoalID message based on the given JSON object. */ public static GoalID fromJsonObject(JsonObject jsonObject) { // check the fields Time stamp = jsonObject.containsKey(GoalID.FIELD_STAMP) ? Time .fromJsonObject(jsonObject.getJsonObject(GoalID.FIELD_STAMP)) : new Time(); String id = jsonObject.containsKey(GoalID.FIELD_ID) ? jsonObject .getString(GoalID.FIELD_ID) : ""; return new GoalID(stamp, id); } }
/** * Create a new Goal based on the given JSON object. Any missing values * will be set to their defaults. * * @param jsonObject * The JSON object to parse. * @return A Goal message based on the given JSON object. */ public static GoalMessage fromJsonObject(JsonObject jsonObject) { Header header = jsonObject.containsKey(GoalMessage.FIELD_HEADER) ? Header.fromJsonObject(jsonObject.getJsonObject(GoalMessage.FIELD_HEADER)) : new Header(); GoalID id = jsonObject.containsKey(GoalMessage.FIELD_ID) ? GoalID.fromJsonObject(jsonObject.getJsonObject(GoalMessage.FIELD_ID)) : new GoalID(); JsonObject goal = jsonObject.containsKey(GoalMessage.FIELD_GOAL) ? jsonObject.getJsonObject(GoalMessage.FIELD_GOAL) : JsonObject.EMPTY_JSON_OBJECT; return new GoalMessage(header, id, goal); } }
/** * Create a new GoalStatus based on the given JSON object. Any missing * values will be set to their defaults. * * @param jsonObject * The JSON object to parse. * @return A GoalStatus message based on the given JSON object. */ public static GoalStatus fromJsonObject(JsonObject jsonObject) { // check the fields GoalID goalID = jsonObject.containsKey(GoalStatus.FIELD_GOAL_ID) ? GoalID .fromJsonObject(jsonObject .getJsonObject(GoalStatus.FIELD_GOAL_ID)) : new GoalID(); byte status = jsonObject.containsKey(GoalStatus.FIELD_STATUS) ? Primitive .toUInt8((short) jsonObject.getInt(GoalStatus.FIELD_STATUS)) : 0; String text = jsonObject.containsKey(GoalStatus.FIELD_TEXT) ? jsonObject .getString(GoalStatus.FIELD_TEXT) : ""; return new GoalStatus(goalID, status, text); } }
/** * Create a new GoalStatus based on the given JSON object. Any missing * values will be set to their defaults. * * @param jsonObject * The JSON object to parse. * @return A GoalStatus message based on the given JSON object. */ public static GoalStatus fromJsonObject(JsonObject jsonObject) { // check the fields GoalID goalID = jsonObject.containsKey(GoalStatus.FIELD_GOAL_ID) ? GoalID .fromJsonObject(jsonObject .getJsonObject(GoalStatus.FIELD_GOAL_ID)) : new GoalID(); byte status = jsonObject.containsKey(GoalStatus.FIELD_STATUS) ? Primitive .toUInt8((short) jsonObject.getInt(GoalStatus.FIELD_STATUS)) : 0; String text = jsonObject.containsKey(GoalStatus.FIELD_TEXT) ? jsonObject .getString(GoalStatus.FIELD_TEXT) : ""; return new GoalStatus(goalID, status, text); } }