コード例 #1
0
  /** Marshall the given parameter object, and output to a SdkJsonGenerator */
  public void marshall(JobWatermark jobWatermark, StructuredJsonGenerator jsonGenerator) {

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

    try {
      jsonGenerator.writeStartObject();

      if (jobWatermark.getPresetWatermarkId() != null) {
        jsonGenerator
            .writeFieldName("PresetWatermarkId")
            .writeValue(jobWatermark.getPresetWatermarkId());
      }
      if (jobWatermark.getInputKey() != null) {
        jsonGenerator.writeFieldName("InputKey").writeValue(jobWatermark.getInputKey());
      }
      if (jobWatermark.getEncryption() != null) {
        jsonGenerator.writeFieldName("Encryption");
        EncryptionJsonMarshaller.getInstance()
            .marshall(jobWatermark.getEncryption(), jsonGenerator);
      }

      jsonGenerator.writeEndObject();
    } 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 JobWatermark == false) return false;
    JobWatermark other = (JobWatermark) obj;
    if (other.getPresetWatermarkId() == null ^ this.getPresetWatermarkId() == null) return false;
    if (other.getPresetWatermarkId() != null
        && other.getPresetWatermarkId().equals(this.getPresetWatermarkId()) == false) return false;
    if (other.getInputKey() == null ^ this.getInputKey() == null) return false;
    if (other.getInputKey() != null && other.getInputKey().equals(this.getInputKey()) == false)
      return false;
    if (other.getEncryption() == null ^ this.getEncryption() == null) return false;
    if (other.getEncryption() != null
        && other.getEncryption().equals(this.getEncryption()) == false) return false;
    return true;
  }