examples/iot-nirvana/common/src/main/java/com/google/cloud/demo/iot/nirvana/common/Message.java
/**
   * Create a Message object from its JSON representation
   *
   * @param json JSON representation of a Message object
   * @return Message object
   */
Create a Message object from its JSON representation
@param json JSON representation of a Message object
@return Message object
Create a Message object from its JSON representation @param json JSON representation of a Message object @return Message object
public static Message fromJson(String json) throws FormatException {
    try {
      Message.Builder messageBuilder = GSON.fromJson(json, AutoValue_Message.Builder.class);
      return messageBuilder.build();
    } catch (Exception e) {
      String message = String.format(DESERIALIZE_JSON_ERR, e.getMessage());
      throw new FormatException(message, e);
    }
  }
public static Message fromJson ( String json ) throws FormatException { try { Message . Builder messageBuilder = GSON . fromJson ( json , AutoValue_Message . Builder . class ) ; return messageBuilder . build ( ) ; } catch ( Exception e ) { String message = String . format ( DESERIALIZE_JSON_ERR , e . getMessage ( ) ) ; throw new FormatException ( message , e ) ; } }
Create a Message object from its JSON representation
 @param json JSON representation of a Message object
 @return Message object
Create a Message object from its JSON representation @param json JSON representation of a Message object @return Message object
// JSON parsing or incomplete JSON exception (both runtime)