com.amazonaws.services.opsworks.model.DescribeTimeBasedAutoScalingResult Maven / Gradle / Ivy
Show all versions of aws-java-sdk-osgi Show documentation
/*
 * Copyright 2010-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.opsworks.model;
import java.io.Serializable;
/**
 * 
 * Contains the response to a DescribeTimeBasedAutoScaling request.
 * 
 */
public class DescribeTimeBasedAutoScalingResult implements Serializable,
        Cloneable {
    /**
     * 
     * An array of TimeBasedAutoScalingConfiguration objects that
     * describe the configuration for the specified instances.
     * 
     */
    private com.amazonaws.internal.SdkInternalList timeBasedAutoScalingConfigurations;
    /**
     * 
     * An array of TimeBasedAutoScalingConfiguration objects that
     * describe the configuration for the specified instances.
     * 
     * 
     * @return An array of TimeBasedAutoScalingConfiguration
     *         objects that describe the configuration for the specified
     *         instances.
     */
    public java.util.List getTimeBasedAutoScalingConfigurations() {
        if (timeBasedAutoScalingConfigurations == null) {
            timeBasedAutoScalingConfigurations = new com.amazonaws.internal.SdkInternalList();
        }
        return timeBasedAutoScalingConfigurations;
    }
    /**
     * 
     * An array of TimeBasedAutoScalingConfiguration objects that
     * describe the configuration for the specified instances.
     * 
     * 
     * @param timeBasedAutoScalingConfigurations
     *        An array of TimeBasedAutoScalingConfiguration objects
     *        that describe the configuration for the specified instances.
     */
    public void setTimeBasedAutoScalingConfigurations(
            java.util.Collection timeBasedAutoScalingConfigurations) {
        if (timeBasedAutoScalingConfigurations == null) {
            this.timeBasedAutoScalingConfigurations = null;
            return;
        }
        this.timeBasedAutoScalingConfigurations = new com.amazonaws.internal.SdkInternalList(
                timeBasedAutoScalingConfigurations);
    }
    /**
     * 
     * An array of TimeBasedAutoScalingConfiguration objects that
     * describe the configuration for the specified instances.
     * 
     * 
     * NOTE: This method appends the values to the existing list (if
     * any). Use
     * {@link #setTimeBasedAutoScalingConfigurations(java.util.Collection)} or
     * {@link #withTimeBasedAutoScalingConfigurations(java.util.Collection)} if
     * you want to override the existing values.
     * 
     * 
     * @param timeBasedAutoScalingConfigurations
     *        An array of TimeBasedAutoScalingConfiguration objects
     *        that describe the configuration for the specified instances.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */
    public DescribeTimeBasedAutoScalingResult withTimeBasedAutoScalingConfigurations(
            TimeBasedAutoScalingConfiguration... timeBasedAutoScalingConfigurations) {
        if (this.timeBasedAutoScalingConfigurations == null) {
            setTimeBasedAutoScalingConfigurations(new com.amazonaws.internal.SdkInternalList(
                    timeBasedAutoScalingConfigurations.length));
        }
        for (TimeBasedAutoScalingConfiguration ele : timeBasedAutoScalingConfigurations) {
            this.timeBasedAutoScalingConfigurations.add(ele);
        }
        return this;
    }
    /**
     * 
     * An array of TimeBasedAutoScalingConfiguration objects that
     * describe the configuration for the specified instances.
     * 
     * 
     * @param timeBasedAutoScalingConfigurations
     *        An array of TimeBasedAutoScalingConfiguration objects
     *        that describe the configuration for the specified instances.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */
    public DescribeTimeBasedAutoScalingResult withTimeBasedAutoScalingConfigurations(
            java.util.Collection timeBasedAutoScalingConfigurations) {
        setTimeBasedAutoScalingConfigurations(timeBasedAutoScalingConfigurations);
        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 (getTimeBasedAutoScalingConfigurations() != null)
            sb.append("TimeBasedAutoScalingConfigurations: "
                    + getTimeBasedAutoScalingConfigurations());
        sb.append("}");
        return sb.toString();
    }
    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (obj instanceof DescribeTimeBasedAutoScalingResult == false)
            return false;
        DescribeTimeBasedAutoScalingResult other = (DescribeTimeBasedAutoScalingResult) obj;
        if (other.getTimeBasedAutoScalingConfigurations() == null
                ^ this.getTimeBasedAutoScalingConfigurations() == null)
            return false;
        if (other.getTimeBasedAutoScalingConfigurations() != null
                && other.getTimeBasedAutoScalingConfigurations().equals(
                        this.getTimeBasedAutoScalingConfigurations()) == false)
            return false;
        return true;
    }
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        hashCode = prime
                * hashCode
                + ((getTimeBasedAutoScalingConfigurations() == null) ? 0
                        : getTimeBasedAutoScalingConfigurations().hashCode());
        return hashCode;
    }
    @Override
    public DescribeTimeBasedAutoScalingResult clone() {
        try {
            return (DescribeTimeBasedAutoScalingResult) super.clone();
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException(
                    "Got a CloneNotSupportedException from Object.clone() "
                            + "even though we're Cloneable!", e);
        }
    }
}