com.amazonaws.services.cloudformation.model.ResourceTargetDefinition Maven / Gradle / Ivy
Show all versions of aws-java-sdk-cloudformation Show documentation
/*
 * Copyright 2011-2016 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;
/**
 * 
 * The field that AWS CloudFormation will change, such as the name of a resource's property, and whether the resource
 * will be recreated.
 * 
 */
public class ResourceTargetDefinition implements Serializable, Cloneable {
    /**
     * 
     * Indicates which resource attribute is triggering this update, such as a change in the resource attribute's
     * Metadata, Properties, or Tags.
     * 
     */
    private String attribute;
    /**
     * 
     * If the Attribute value is Properties, the name of the property. For all other
     * attributes, the value is null.
     * 
     */
    private String name;
    /**
     * 
     * If the Attribute value is Properties, indicates whether a change to this property
     * causes the resource to be recreated. The value can be Never, Always, or
     * Conditionally. To determine the conditions for a Conditionally recreation, see the
     * update behavior for that property in the AWS CloudFormation User Guide.
     * 
     */
    private String requiresRecreation;
    /**
     * 
     * Indicates which resource attribute is triggering this update, such as a change in the resource attribute's
     * Metadata, Properties, or Tags.
     * 
     * 
     * @param attribute
     *        Indicates which resource attribute is triggering this update, such as a change in the resource attribute's
     *        Metadata, Properties, or Tags.
     * @see ResourceAttribute
     */
    public void setAttribute(String attribute) {
        this.attribute = attribute;
    }
    /**
     * 
     * Indicates which resource attribute is triggering this update, such as a change in the resource attribute's
     * Metadata, Properties, or Tags.
     * 
     * 
     * @return Indicates which resource attribute is triggering this update, such as a change in the resource
     *         attribute's Metadata, Properties, or Tags.
     * @see ResourceAttribute
     */
    public String getAttribute() {
        return this.attribute;
    }
    /**
     * 
     * Indicates which resource attribute is triggering this update, such as a change in the resource attribute's
     * Metadata, Properties, or Tags.
     * 
     * 
     * @param attribute
     *        Indicates which resource attribute is triggering this update, such as a change in the resource attribute's
     *        Metadata, Properties, or Tags.
     * @return Returns a reference to this object so that method calls can be chained together.
     * @see ResourceAttribute
     */
    public ResourceTargetDefinition withAttribute(String attribute) {
        setAttribute(attribute);
        return this;
    }
    /**
     * 
     * Indicates which resource attribute is triggering this update, such as a change in the resource attribute's
     * Metadata, Properties, or Tags.
     * 
     * 
     * @param attribute
     *        Indicates which resource attribute is triggering this update, such as a change in the resource attribute's
     *        Metadata, Properties, or Tags.
     * @see ResourceAttribute
     */
    public void setAttribute(ResourceAttribute attribute) {
        this.attribute = attribute.toString();
    }
    /**
     * 
     * Indicates which resource attribute is triggering this update, such as a change in the resource attribute's
     * Metadata, Properties, or Tags.
     * 
     * 
     * @param attribute
     *        Indicates which resource attribute is triggering this update, such as a change in the resource attribute's
     *        Metadata, Properties, or Tags.
     * @return Returns a reference to this object so that method calls can be chained together.
     * @see ResourceAttribute
     */
    public ResourceTargetDefinition withAttribute(ResourceAttribute attribute) {
        setAttribute(attribute);
        return this;
    }
    /**
     * 
     * If the Attribute value is Properties, the name of the property. For all other
     * attributes, the value is null.
     * 
     * 
     * @param name
     *        If the Attribute value is Properties, the name of the property. For all other
     *        attributes, the value is null.
     */
    public void setName(String name) {
        this.name = name;
    }
    /**
     * 
     * If the Attribute value is Properties, the name of the property. For all other
     * attributes, the value is null.
     * 
     * 
     * @return If the Attribute value is Properties, the name of the property. For all other
     *         attributes, the value is null.
     */
    public String getName() {
        return this.name;
    }
    /**
     * 
     * If the Attribute value is Properties, the name of the property. For all other
     * attributes, the value is null.
     * 
     * 
     * @param name
     *        If the Attribute value is Properties, the name of the property. For all other
     *        attributes, the value is null.
     * @return Returns a reference to this object so that method calls can be chained together.
     */
    public ResourceTargetDefinition withName(String name) {
        setName(name);
        return this;
    }
    /**
     * 
     * If the Attribute value is Properties, indicates whether a change to this property
     * causes the resource to be recreated. The value can be Never, Always, or
     * Conditionally. To determine the conditions for a Conditionally recreation, see the
     * update behavior for that property in the AWS CloudFormation User Guide.
     * 
     * 
     * @param requiresRecreation
     *        If the Attribute value is Properties, indicates whether a change to this
     *        property causes the resource to be recreated. The value can be Never, Always, or
     *        Conditionally. To determine the conditions for a Conditionally recreation, see
     *        the update behavior for that property in the AWS CloudFormation User Guide.
     * @see RequiresRecreation
     */
    public void setRequiresRecreation(String requiresRecreation) {
        this.requiresRecreation = requiresRecreation;
    }
    /**
     * 
     * If the Attribute value is Properties, indicates whether a change to this property
     * causes the resource to be recreated. The value can be Never, Always, or
     * Conditionally. To determine the conditions for a Conditionally recreation, see the
     * update behavior for that property in the AWS CloudFormation User Guide.
     * 
     * 
     * @return If the Attribute value is Properties, indicates whether a change to this
     *         property causes the resource to be recreated. The value can be Never, Always,
     *         or Conditionally. To determine the conditions for a Conditionally recreation,
     *         see the update behavior for that property in the AWS CloudFormation User Guide.
     * @see RequiresRecreation
     */
    public String getRequiresRecreation() {
        return this.requiresRecreation;
    }
    /**
     * 
     * If the Attribute value is Properties, indicates whether a change to this property
     * causes the resource to be recreated. The value can be Never, Always, or
     * Conditionally. To determine the conditions for a Conditionally recreation, see the
     * update behavior for that property in the AWS CloudFormation User Guide.
     * 
     * 
     * @param requiresRecreation
     *        If the Attribute value is Properties, indicates whether a change to this
     *        property causes the resource to be recreated. The value can be Never, Always, or
     *        Conditionally. To determine the conditions for a Conditionally recreation, see
     *        the update behavior for that property in the AWS CloudFormation User Guide.
     * @return Returns a reference to this object so that method calls can be chained together.
     * @see RequiresRecreation
     */
    public ResourceTargetDefinition withRequiresRecreation(String requiresRecreation) {
        setRequiresRecreation(requiresRecreation);
        return this;
    }
    /**
     * 
     * If the Attribute value is Properties, indicates whether a change to this property
     * causes the resource to be recreated. The value can be Never, Always, or
     * Conditionally. To determine the conditions for a Conditionally recreation, see the
     * update behavior for that property in the AWS CloudFormation User Guide.
     * 
     * 
     * @param requiresRecreation
     *        If the Attribute value is Properties, indicates whether a change to this
     *        property causes the resource to be recreated. The value can be Never, Always, or
     *        Conditionally. To determine the conditions for a Conditionally recreation, see
     *        the update behavior for that property in the AWS CloudFormation User Guide.
     * @see RequiresRecreation
     */
    public void setRequiresRecreation(RequiresRecreation requiresRecreation) {
        this.requiresRecreation = requiresRecreation.toString();
    }
    /**
     * 
     * If the Attribute value is Properties, indicates whether a change to this property
     * causes the resource to be recreated. The value can be Never, Always, or
     * Conditionally. To determine the conditions for a Conditionally recreation, see the
     * update behavior for that property in the AWS CloudFormation User Guide.
     * 
     * 
     * @param requiresRecreation
     *        If the Attribute value is Properties, indicates whether a change to this
     *        property causes the resource to be recreated. The value can be Never, Always, or
     *        Conditionally. To determine the conditions for a Conditionally recreation, see
     *        the update behavior for that property in the AWS CloudFormation User Guide.
     * @return Returns a reference to this object so that method calls can be chained together.
     * @see RequiresRecreation
     */
    public ResourceTargetDefinition withRequiresRecreation(RequiresRecreation requiresRecreation) {
        setRequiresRecreation(requiresRecreation);
        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 (getAttribute() != null)
            sb.append("Attribute: " + getAttribute() + ",");
        if (getName() != null)
            sb.append("Name: " + getName() + ",");
        if (getRequiresRecreation() != null)
            sb.append("RequiresRecreation: " + getRequiresRecreation());
        sb.append("}");
        return sb.toString();
    }
    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (obj instanceof ResourceTargetDefinition == false)
            return false;
        ResourceTargetDefinition other = (ResourceTargetDefinition) obj;
        if (other.getAttribute() == null ^ this.getAttribute() == null)
            return false;
        if (other.getAttribute() != null && other.getAttribute().equals(this.getAttribute()) == 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.getRequiresRecreation() == null ^ this.getRequiresRecreation() == null)
            return false;
        if (other.getRequiresRecreation() != null && other.getRequiresRecreation().equals(this.getRequiresRecreation()) == false)
            return false;
        return true;
    }
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        hashCode = prime * hashCode + ((getAttribute() == null) ? 0 : getAttribute().hashCode());
        hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode());
        hashCode = prime * hashCode + ((getRequiresRecreation() == null) ? 0 : getRequiresRecreation().hashCode());
        return hashCode;
    }
    @Override
    public ResourceTargetDefinition clone() {
        try {
            return (ResourceTargetDefinition) super.clone();
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
        }
    }
}