/** Marshall the given parameter object, and output to a JSONWriter */
  public void marshall(Telemetry telemetry, JSONWriter jsonWriter) {
    if (telemetry == null) {
      throw new AmazonClientException("Invalid argument passed to marshall(...)");
    }

    try {
      jsonWriter.object();

      if (telemetry.getStatus() != null) {
        jsonWriter.key("status").value(telemetry.getStatus());
      }

      java.util.List<MessageTypeTelemetry> messageTypeTelemetriesList =
          telemetry.getMessageTypeTelemetries();
      if (messageTypeTelemetriesList != null) {
        jsonWriter.key("messageTypeTelemetries");
        jsonWriter.array();
        for (MessageTypeTelemetry messageTypeTelemetriesListValue : messageTypeTelemetriesList) {
          if (messageTypeTelemetriesListValue != null) {

            MessageTypeTelemetryJsonMarshaller.getInstance()
                .marshall(messageTypeTelemetriesListValue, jsonWriter);
          }
        }
        jsonWriter.endArray();
      }

      jsonWriter.endObject();
    } catch (Throwable t) {
      throw new AmazonClientException("Unable to marshall request to JSON: " + t.getMessage(), t);
    }
  }
Пример #2
0
  @Override
  public boolean equals(Object obj) {
    if (this == obj) return true;
    if (obj == null) return false;

    if (obj instanceof Telemetry == false) return false;
    Telemetry other = (Telemetry) obj;
    if (other.getStatus() == null ^ this.getStatus() == null) return false;
    if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == false)
      return false;
    if (other.getMessageTypeTelemetries() == null ^ this.getMessageTypeTelemetries() == null)
      return false;
    if (other.getMessageTypeTelemetries() != null
        && other.getMessageTypeTelemetries().equals(this.getMessageTypeTelemetries()) == false)
      return false;
    return true;
  }