Example #1
0
 /**
  * Create a new Twist based on the given Message. Any missing values will be set to their
  * defaults.
  *
  * @param m The Message to parse.
  * @return A Twist message based on the given Message.
  */
 public static Twist fromMessage(Message m) {
   // get it from the JSON object
   return Twist.fromJsonObject(m.toJsonObject());
 }
Example #2
0
 /**
  * Create a new Twist based on the given JSON string. Any missing values will be set to their
  * defaults.
  *
  * @param jsonString The JSON string to parse.
  * @return A Twist message based on the given JSON string.
  */
 public static Twist fromJsonString(String jsonString) {
   // convert to a message
   return Twist.fromMessage(new Message(jsonString));
 }