/* * Copyright 2012-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.simplesystemsmanagement.model; import java.io.Serializable; import javax.annotation.Generated; /** * * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/UpdatePatchBaseline" target="_top">AWS API * Documentation</a> */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class UpdatePatchBaselineResult extends com.amazonaws.AmazonWebServiceResult<com.amazonaws.ResponseMetadata> implements Serializable, Cloneable { /** * <p> * The ID of the deleted patch baseline. * </p> */ private String baselineId; /** * <p> * The name of the patch baseline. * </p> */ private String name; /** * <p> * A set of global filters used to exclude patches from the baseline. * </p> */ private PatchFilterGroup globalFilters; /** * <p> * A set of rules used to include patches in the baseline. * </p> */ private PatchRuleGroup approvalRules; /** * <p> * A list of explicitly approved patches for the baseline. * </p> */ private com.amazonaws.internal.SdkInternalList<String> approvedPatches; /** * <p> * A list of explicitly rejected patches for the baseline. * </p> */ private com.amazonaws.internal.SdkInternalList<String> rejectedPatches; /** * <p> * The date when the patch baseline was created. * </p> */ private java.util.Date createdDate; /** * <p> * The date when the patch baseline was last modified. * </p> */ private java.util.Date modifiedDate; /** * <p> * A description of the Patch Baseline. * </p> */ private String description; /** * <p> * The ID of the deleted patch baseline. * </p> * * @param baselineId * The ID of the deleted patch baseline. */ public void setBaselineId(String baselineId) { this.baselineId = baselineId; } /** * <p> * The ID of the deleted patch baseline. * </p> * * @return The ID of the deleted patch baseline. */ public String getBaselineId() { return this.baselineId; } /** * <p> * The ID of the deleted patch baseline. * </p> * * @param baselineId * The ID of the deleted patch baseline. * @return Returns a reference to this object so that method calls can be chained together. */ public UpdatePatchBaselineResult withBaselineId(String baselineId) { setBaselineId(baselineId); return this; } /** * <p> * The name of the patch baseline. * </p> * * @param name * The name of the patch baseline. */ public void setName(String name) { this.name = name; } /** * <p> * The name of the patch baseline. * </p> * * @return The name of the patch baseline. */ public String getName() { return this.name; } /** * <p> * The name of the patch baseline. * </p> * * @param name * The name of the patch baseline. * @return Returns a reference to this object so that method calls can be chained together. */ public UpdatePatchBaselineResult withName(String name) { setName(name); return this; } /** * <p> * A set of global filters used to exclude patches from the baseline. * </p> * * @param globalFilters * A set of global filters used to exclude patches from the baseline. */ public void setGlobalFilters(PatchFilterGroup globalFilters) { this.globalFilters = globalFilters; } /** * <p> * A set of global filters used to exclude patches from the baseline. * </p> * * @return A set of global filters used to exclude patches from the baseline. */ public PatchFilterGroup getGlobalFilters() { return this.globalFilters; } /** * <p> * A set of global filters used to exclude patches from the baseline. * </p> * * @param globalFilters * A set of global filters used to exclude patches from the baseline. * @return Returns a reference to this object so that method calls can be chained together. */ public UpdatePatchBaselineResult withGlobalFilters(PatchFilterGroup globalFilters) { setGlobalFilters(globalFilters); return this; } /** * <p> * A set of rules used to include patches in the baseline. * </p> * * @param approvalRules * A set of rules used to include patches in the baseline. */ public void setApprovalRules(PatchRuleGroup approvalRules) { this.approvalRules = approvalRules; } /** * <p> * A set of rules used to include patches in the baseline. * </p> * * @return A set of rules used to include patches in the baseline. */ public PatchRuleGroup getApprovalRules() { return this.approvalRules; } /** * <p> * A set of rules used to include patches in the baseline. * </p> * * @param approvalRules * A set of rules used to include patches in the baseline. * @return Returns a reference to this object so that method calls can be chained together. */ public UpdatePatchBaselineResult withApprovalRules(PatchRuleGroup approvalRules) { setApprovalRules(approvalRules); return this; } /** * <p> * A list of explicitly approved patches for the baseline. * </p> * * @return A list of explicitly approved patches for the baseline. */ public java.util.List<String> getApprovedPatches() { if (approvedPatches == null) { approvedPatches = new com.amazonaws.internal.SdkInternalList<String>(); } return approvedPatches; } /** * <p> * A list of explicitly approved patches for the baseline. * </p> * * @param approvedPatches * A list of explicitly approved patches for the baseline. */ public void setApprovedPatches(java.util.Collection<String> approvedPatches) { if (approvedPatches == null) { this.approvedPatches = null; return; } this.approvedPatches = new com.amazonaws.internal.SdkInternalList<String>(approvedPatches); } /** * <p> * A list of explicitly approved patches for the baseline. * </p> * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setApprovedPatches(java.util.Collection)} or {@link #withApprovedPatches(java.util.Collection)} if you * want to override the existing values. * </p> * * @param approvedPatches * A list of explicitly approved patches for the baseline. * @return Returns a reference to this object so that method calls can be chained together. */ public UpdatePatchBaselineResult withApprovedPatches(String... approvedPatches) { if (this.approvedPatches == null) { setApprovedPatches(new com.amazonaws.internal.SdkInternalList<String>(approvedPatches.length)); } for (String ele : approvedPatches) { this.approvedPatches.add(ele); } return this; } /** * <p> * A list of explicitly approved patches for the baseline. * </p> * * @param approvedPatches * A list of explicitly approved patches for the baseline. * @return Returns a reference to this object so that method calls can be chained together. */ public UpdatePatchBaselineResult withApprovedPatches(java.util.Collection<String> approvedPatches) { setApprovedPatches(approvedPatches); return this; } /** * <p> * A list of explicitly rejected patches for the baseline. * </p> * * @return A list of explicitly rejected patches for the baseline. */ public java.util.List<String> getRejectedPatches() { if (rejectedPatches == null) { rejectedPatches = new com.amazonaws.internal.SdkInternalList<String>(); } return rejectedPatches; } /** * <p> * A list of explicitly rejected patches for the baseline. * </p> * * @param rejectedPatches * A list of explicitly rejected patches for the baseline. */ public void setRejectedPatches(java.util.Collection<String> rejectedPatches) { if (rejectedPatches == null) { this.rejectedPatches = null; return; } this.rejectedPatches = new com.amazonaws.internal.SdkInternalList<String>(rejectedPatches); } /** * <p> * A list of explicitly rejected patches for the baseline. * </p> * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setRejectedPatches(java.util.Collection)} or {@link #withRejectedPatches(java.util.Collection)} if you * want to override the existing values. * </p> * * @param rejectedPatches * A list of explicitly rejected patches for the baseline. * @return Returns a reference to this object so that method calls can be chained together. */ public UpdatePatchBaselineResult withRejectedPatches(String... rejectedPatches) { if (this.rejectedPatches == null) { setRejectedPatches(new com.amazonaws.internal.SdkInternalList<String>(rejectedPatches.length)); } for (String ele : rejectedPatches) { this.rejectedPatches.add(ele); } return this; } /** * <p> * A list of explicitly rejected patches for the baseline. * </p> * * @param rejectedPatches * A list of explicitly rejected patches for the baseline. * @return Returns a reference to this object so that method calls can be chained together. */ public UpdatePatchBaselineResult withRejectedPatches(java.util.Collection<String> rejectedPatches) { setRejectedPatches(rejectedPatches); return this; } /** * <p> * The date when the patch baseline was created. * </p> * * @param createdDate * The date when the patch baseline was created. */ public void setCreatedDate(java.util.Date createdDate) { this.createdDate = createdDate; } /** * <p> * The date when the patch baseline was created. * </p> * * @return The date when the patch baseline was created. */ public java.util.Date getCreatedDate() { return this.createdDate; } /** * <p> * The date when the patch baseline was created. * </p> * * @param createdDate * The date when the patch baseline was created. * @return Returns a reference to this object so that method calls can be chained together. */ public UpdatePatchBaselineResult withCreatedDate(java.util.Date createdDate) { setCreatedDate(createdDate); return this; } /** * <p> * The date when the patch baseline was last modified. * </p> * * @param modifiedDate * The date when the patch baseline was last modified. */ public void setModifiedDate(java.util.Date modifiedDate) { this.modifiedDate = modifiedDate; } /** * <p> * The date when the patch baseline was last modified. * </p> * * @return The date when the patch baseline was last modified. */ public java.util.Date getModifiedDate() { return this.modifiedDate; } /** * <p> * The date when the patch baseline was last modified. * </p> * * @param modifiedDate * The date when the patch baseline was last modified. * @return Returns a reference to this object so that method calls can be chained together. */ public UpdatePatchBaselineResult withModifiedDate(java.util.Date modifiedDate) { setModifiedDate(modifiedDate); return this; } /** * <p> * A description of the Patch Baseline. * </p> * * @param description * A description of the Patch Baseline. */ public void setDescription(String description) { this.description = description; } /** * <p> * A description of the Patch Baseline. * </p> * * @return A description of the Patch Baseline. */ public String getDescription() { return this.description; } /** * <p> * A description of the Patch Baseline. * </p> * * @param description * A description of the Patch Baseline. * @return Returns a reference to this object so that method calls can be chained together. */ public UpdatePatchBaselineResult withDescription(String description) { setDescription(description); return this; } /** * Returns a string representation of this object; useful for testing and debugging. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getBaselineId() != null) sb.append("BaselineId: ").append(getBaselineId()).append(","); if (getName() != null) sb.append("Name: ").append(getName()).append(","); if (getGlobalFilters() != null) sb.append("GlobalFilters: ").append(getGlobalFilters()).append(","); if (getApprovalRules() != null) sb.append("ApprovalRules: ").append(getApprovalRules()).append(","); if (getApprovedPatches() != null) sb.append("ApprovedPatches: ").append(getApprovedPatches()).append(","); if (getRejectedPatches() != null) sb.append("RejectedPatches: ").append(getRejectedPatches()).append(","); if (getCreatedDate() != null) sb.append("CreatedDate: ").append(getCreatedDate()).append(","); if (getModifiedDate() != null) sb.append("ModifiedDate: ").append(getModifiedDate()).append(","); if (getDescription() != null) sb.append("Description: ").append(getDescription()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof UpdatePatchBaselineResult == false) return false; UpdatePatchBaselineResult other = (UpdatePatchBaselineResult) obj; if (other.getBaselineId() == null ^ this.getBaselineId() == null) return false; if (other.getBaselineId() != null && other.getBaselineId().equals(this.getBaselineId()) == false) return false; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == false) return false; if (other.getGlobalFilters() == null ^ this.getGlobalFilters() == null) return false; if (other.getGlobalFilters() != null && other.getGlobalFilters().equals(this.getGlobalFilters()) == false) return false; if (other.getApprovalRules() == null ^ this.getApprovalRules() == null) return false; if (other.getApprovalRules() != null && other.getApprovalRules().equals(this.getApprovalRules()) == false) return false; if (other.getApprovedPatches() == null ^ this.getApprovedPatches() == null) return false; if (other.getApprovedPatches() != null && other.getApprovedPatches().equals(this.getApprovedPatches()) == false) return false; if (other.getRejectedPatches() == null ^ this.getRejectedPatches() == null) return false; if (other.getRejectedPatches() != null && other.getRejectedPatches().equals(this.getRejectedPatches()) == false) return false; if (other.getCreatedDate() == null ^ this.getCreatedDate() == null) return false; if (other.getCreatedDate() != null && other.getCreatedDate().equals(this.getCreatedDate()) == false) return false; if (other.getModifiedDate() == null ^ this.getModifiedDate() == null) return false; if (other.getModifiedDate() != null && other.getModifiedDate().equals(this.getModifiedDate()) == false) return false; if (other.getDescription() == null ^ this.getDescription() == null) return false; if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getBaselineId() == null) ? 0 : getBaselineId().hashCode()); hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getGlobalFilters() == null) ? 0 : getGlobalFilters().hashCode()); hashCode = prime * hashCode + ((getApprovalRules() == null) ? 0 : getApprovalRules().hashCode()); hashCode = prime * hashCode + ((getApprovedPatches() == null) ? 0 : getApprovedPatches().hashCode()); hashCode = prime * hashCode + ((getRejectedPatches() == null) ? 0 : getRejectedPatches().hashCode()); hashCode = prime * hashCode + ((getCreatedDate() == null) ? 0 : getCreatedDate().hashCode()); hashCode = prime * hashCode + ((getModifiedDate() == null) ? 0 : getModifiedDate().hashCode()); hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode()); return hashCode; } @Override public UpdatePatchBaselineResult clone() { try { return (UpdatePatchBaselineResult) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } }