/** Marshall the given parameter object, and output to a SdkJsonGenerator */
  public void marshall(PipelineSummary pipelineSummary, StructuredJsonGenerator jsonGenerator) {

    if (pipelineSummary == null) {
      throw new AmazonClientException("Invalid argument passed to marshall(...)");
    }

    try {
      jsonGenerator.writeStartObject();

      if (pipelineSummary.getName() != null) {
        jsonGenerator.writeFieldName("name").writeValue(pipelineSummary.getName());
      }
      if (pipelineSummary.getVersion() != null) {
        jsonGenerator.writeFieldName("version").writeValue(pipelineSummary.getVersion());
      }
      if (pipelineSummary.getCreated() != null) {
        jsonGenerator.writeFieldName("created").writeValue(pipelineSummary.getCreated());
      }
      if (pipelineSummary.getUpdated() != null) {
        jsonGenerator.writeFieldName("updated").writeValue(pipelineSummary.getUpdated());
      }

      jsonGenerator.writeEndObject();
    } catch (Throwable t) {
      throw new AmazonClientException("Unable to marshall request to JSON: " + t.getMessage(), t);
    }
  }
Exemplo n.º 2
0
  @Override
  public boolean equals(Object obj) {
    if (this == obj) return true;
    if (obj == null) return false;

    if (obj instanceof PipelineSummary == false) return false;
    PipelineSummary other = (PipelineSummary) obj;
    if (other.getName() == null ^ this.getName() == null) return false;
    if (other.getName() != null && other.getName().equals(this.getName()) == false) return false;
    if (other.getVersion() == null ^ this.getVersion() == null) return false;
    if (other.getVersion() != null && other.getVersion().equals(this.getVersion()) == false)
      return false;
    if (other.getCreated() == null ^ this.getCreated() == null) return false;
    if (other.getCreated() != null && other.getCreated().equals(this.getCreated()) == false)
      return false;
    if (other.getUpdated() == null ^ this.getUpdated() == null) return false;
    if (other.getUpdated() != null && other.getUpdated().equals(this.getUpdated()) == false)
      return false;
    return true;
  }