com.amazonaws.services.cloudformation.model.TemplateConfiguration Maven / Gradle / Ivy
Show all versions of aws-java-sdk-cloudformation Show documentation
/*
* Copyright 2019-2024 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.cloudformation.model;
import java.io.Serializable;
import javax.annotation.Generated;
/**
*
* The configuration details of a generated template.
*
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class TemplateConfiguration implements Serializable, Cloneable {
/**
*
* The DeletionPolicy
assigned to resources in the generated template. Supported values are:
*
*
* -
*
* DELETE
- delete all resources when the stack is deleted.
*
*
* -
*
* RETAIN
- retain all resources when the stack is deleted.
*
*
*
*
* For more information, see DeletionPolicy attribute in the CloudFormation User Guide.
*
*/
private String deletionPolicy;
/**
*
* The UpdateReplacePolicy
assigned to resources in the generated template. Supported values are:
*
*
* -
*
* DELETE
- delete all resources when the resource is replaced during an update operation.
*
*
* -
*
* RETAIN
- retain all resources when the resource is replaced during an update operation.
*
*
*
*
* For more information, see UpdateReplacePolicy attribute in the CloudFormation User Guide.
*
*/
private String updateReplacePolicy;
/**
*
* The DeletionPolicy
assigned to resources in the generated template. Supported values are:
*
*
* -
*
* DELETE
- delete all resources when the stack is deleted.
*
*
* -
*
* RETAIN
- retain all resources when the stack is deleted.
*
*
*
*
* For more information, see DeletionPolicy attribute in the CloudFormation User Guide.
*
*
* @param deletionPolicy
* The DeletionPolicy
assigned to resources in the generated template. Supported values are:
*
* -
*
* DELETE
- delete all resources when the stack is deleted.
*
*
* -
*
* RETAIN
- retain all resources when the stack is deleted.
*
*
*
*
* For more information, see DeletionPolicy attribute in the CloudFormation User Guide.
* @see GeneratedTemplateDeletionPolicy
*/
public void setDeletionPolicy(String deletionPolicy) {
this.deletionPolicy = deletionPolicy;
}
/**
*
* The DeletionPolicy
assigned to resources in the generated template. Supported values are:
*
*
* -
*
* DELETE
- delete all resources when the stack is deleted.
*
*
* -
*
* RETAIN
- retain all resources when the stack is deleted.
*
*
*
*
* For more information, see DeletionPolicy attribute in the CloudFormation User Guide.
*
*
* @return The DeletionPolicy
assigned to resources in the generated template. Supported values
* are:
*
* -
*
* DELETE
- delete all resources when the stack is deleted.
*
*
* -
*
* RETAIN
- retain all resources when the stack is deleted.
*
*
*
*
* For more information, see DeletionPolicy attribute in the CloudFormation User Guide.
* @see GeneratedTemplateDeletionPolicy
*/
public String getDeletionPolicy() {
return this.deletionPolicy;
}
/**
*
* The DeletionPolicy
assigned to resources in the generated template. Supported values are:
*
*
* -
*
* DELETE
- delete all resources when the stack is deleted.
*
*
* -
*
* RETAIN
- retain all resources when the stack is deleted.
*
*
*
*
* For more information, see DeletionPolicy attribute in the CloudFormation User Guide.
*
*
* @param deletionPolicy
* The DeletionPolicy
assigned to resources in the generated template. Supported values are:
*
* -
*
* DELETE
- delete all resources when the stack is deleted.
*
*
* -
*
* RETAIN
- retain all resources when the stack is deleted.
*
*
*
*
* For more information, see DeletionPolicy attribute in the CloudFormation User Guide.
* @return Returns a reference to this object so that method calls can be chained together.
* @see GeneratedTemplateDeletionPolicy
*/
public TemplateConfiguration withDeletionPolicy(String deletionPolicy) {
setDeletionPolicy(deletionPolicy);
return this;
}
/**
*
* The DeletionPolicy
assigned to resources in the generated template. Supported values are:
*
*
* -
*
* DELETE
- delete all resources when the stack is deleted.
*
*
* -
*
* RETAIN
- retain all resources when the stack is deleted.
*
*
*
*
* For more information, see DeletionPolicy attribute in the CloudFormation User Guide.
*
*
* @param deletionPolicy
* The DeletionPolicy
assigned to resources in the generated template. Supported values are:
*
* -
*
* DELETE
- delete all resources when the stack is deleted.
*
*
* -
*
* RETAIN
- retain all resources when the stack is deleted.
*
*
*
*
* For more information, see DeletionPolicy attribute in the CloudFormation User Guide.
* @return Returns a reference to this object so that method calls can be chained together.
* @see GeneratedTemplateDeletionPolicy
*/
public TemplateConfiguration withDeletionPolicy(GeneratedTemplateDeletionPolicy deletionPolicy) {
this.deletionPolicy = deletionPolicy.toString();
return this;
}
/**
*
* The UpdateReplacePolicy
assigned to resources in the generated template. Supported values are:
*
*
* -
*
* DELETE
- delete all resources when the resource is replaced during an update operation.
*
*
* -
*
* RETAIN
- retain all resources when the resource is replaced during an update operation.
*
*
*
*
* For more information, see UpdateReplacePolicy attribute in the CloudFormation User Guide.
*
*
* @param updateReplacePolicy
* The UpdateReplacePolicy
assigned to resources in the generated template. Supported values
* are:
*
* -
*
* DELETE
- delete all resources when the resource is replaced during an update operation.
*
*
* -
*
* RETAIN
- retain all resources when the resource is replaced during an update operation.
*
*
*
*
* For more information, see UpdateReplacePolicy attribute in the CloudFormation User Guide.
* @see GeneratedTemplateUpdateReplacePolicy
*/
public void setUpdateReplacePolicy(String updateReplacePolicy) {
this.updateReplacePolicy = updateReplacePolicy;
}
/**
*
* The UpdateReplacePolicy
assigned to resources in the generated template. Supported values are:
*
*
* -
*
* DELETE
- delete all resources when the resource is replaced during an update operation.
*
*
* -
*
* RETAIN
- retain all resources when the resource is replaced during an update operation.
*
*
*
*
* For more information, see UpdateReplacePolicy attribute in the CloudFormation User Guide.
*
*
* @return The UpdateReplacePolicy
assigned to resources in the generated template. Supported values
* are:
*
* -
*
* DELETE
- delete all resources when the resource is replaced during an update operation.
*
*
* -
*
* RETAIN
- retain all resources when the resource is replaced during an update operation.
*
*
*
*
* For more information, see UpdateReplacePolicy attribute in the CloudFormation User Guide.
* @see GeneratedTemplateUpdateReplacePolicy
*/
public String getUpdateReplacePolicy() {
return this.updateReplacePolicy;
}
/**
*
* The UpdateReplacePolicy
assigned to resources in the generated template. Supported values are:
*
*
* -
*
* DELETE
- delete all resources when the resource is replaced during an update operation.
*
*
* -
*
* RETAIN
- retain all resources when the resource is replaced during an update operation.
*
*
*
*
* For more information, see UpdateReplacePolicy attribute in the CloudFormation User Guide.
*
*
* @param updateReplacePolicy
* The UpdateReplacePolicy
assigned to resources in the generated template. Supported values
* are:
*
* -
*
* DELETE
- delete all resources when the resource is replaced during an update operation.
*
*
* -
*
* RETAIN
- retain all resources when the resource is replaced during an update operation.
*
*
*
*
* For more information, see UpdateReplacePolicy attribute in the CloudFormation User Guide.
* @return Returns a reference to this object so that method calls can be chained together.
* @see GeneratedTemplateUpdateReplacePolicy
*/
public TemplateConfiguration withUpdateReplacePolicy(String updateReplacePolicy) {
setUpdateReplacePolicy(updateReplacePolicy);
return this;
}
/**
*
* The UpdateReplacePolicy
assigned to resources in the generated template. Supported values are:
*
*
* -
*
* DELETE
- delete all resources when the resource is replaced during an update operation.
*
*
* -
*
* RETAIN
- retain all resources when the resource is replaced during an update operation.
*
*
*
*
* For more information, see UpdateReplacePolicy attribute in the CloudFormation User Guide.
*
*
* @param updateReplacePolicy
* The UpdateReplacePolicy
assigned to resources in the generated template. Supported values
* are:
*
* -
*
* DELETE
- delete all resources when the resource is replaced during an update operation.
*
*
* -
*
* RETAIN
- retain all resources when the resource is replaced during an update operation.
*
*
*
*
* For more information, see UpdateReplacePolicy attribute in the CloudFormation User Guide.
* @return Returns a reference to this object so that method calls can be chained together.
* @see GeneratedTemplateUpdateReplacePolicy
*/
public TemplateConfiguration withUpdateReplacePolicy(GeneratedTemplateUpdateReplacePolicy updateReplacePolicy) {
this.updateReplacePolicy = updateReplacePolicy.toString();
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getDeletionPolicy() != null)
sb.append("DeletionPolicy: ").append(getDeletionPolicy()).append(",");
if (getUpdateReplacePolicy() != null)
sb.append("UpdateReplacePolicy: ").append(getUpdateReplacePolicy());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof TemplateConfiguration == false)
return false;
TemplateConfiguration other = (TemplateConfiguration) obj;
if (other.getDeletionPolicy() == null ^ this.getDeletionPolicy() == null)
return false;
if (other.getDeletionPolicy() != null && other.getDeletionPolicy().equals(this.getDeletionPolicy()) == false)
return false;
if (other.getUpdateReplacePolicy() == null ^ this.getUpdateReplacePolicy() == null)
return false;
if (other.getUpdateReplacePolicy() != null && other.getUpdateReplacePolicy().equals(this.getUpdateReplacePolicy()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getDeletionPolicy() == null) ? 0 : getDeletionPolicy().hashCode());
hashCode = prime * hashCode + ((getUpdateReplacePolicy() == null) ? 0 : getUpdateReplacePolicy().hashCode());
return hashCode;
}
@Override
public TemplateConfiguration clone() {
try {
return (TemplateConfiguration) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}