com.amazonaws.services.ec2.model.VolumeStatusItem Maven / Gradle / Ivy
Show all versions of aws-java-sdk-ec2 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.ec2.model;
import java.io.Serializable;
/**
 * 
 * Describes the volume status.
 * 
 */
public class VolumeStatusItem implements Serializable, Cloneable {
    /**
     * 
     * The volume ID.
     * 
     */
    private String volumeId;
    /**
     * 
     * The Availability Zone of the volume.
     * 
     */
    private String availabilityZone;
    /**
     * 
     * The volume status.
     * 
     */
    private VolumeStatusInfo volumeStatus;
    /**
     * 
     * A list of events associated with the volume.
     * 
     */
    private com.amazonaws.internal.SdkInternalList events;
    /**
     * 
     * The details of the operation.
     * 
     */
    private com.amazonaws.internal.SdkInternalList actions;
    /**
     * 
     * The volume ID.
     * 
     * 
     * @param volumeId
     *        The volume ID.
     */
    public void setVolumeId(String volumeId) {
        this.volumeId = volumeId;
    }
    /**
     * 
     * The volume ID.
     * 
     * 
     * @return The volume ID.
     */
    public String getVolumeId() {
        return this.volumeId;
    }
    /**
     * 
     * The volume ID.
     * 
     * 
     * @param volumeId
     *        The volume ID.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */
    public VolumeStatusItem withVolumeId(String volumeId) {
        setVolumeId(volumeId);
        return this;
    }
    /**
     * 
     * The Availability Zone of the volume.
     * 
     * 
     * @param availabilityZone
     *        The Availability Zone of the volume.
     */
    public void setAvailabilityZone(String availabilityZone) {
        this.availabilityZone = availabilityZone;
    }
    /**
     * 
     * The Availability Zone of the volume.
     * 
     * 
     * @return The Availability Zone of the volume.
     */
    public String getAvailabilityZone() {
        return this.availabilityZone;
    }
    /**
     * 
     * The Availability Zone of the volume.
     * 
     * 
     * @param availabilityZone
     *        The Availability Zone of the volume.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */
    public VolumeStatusItem withAvailabilityZone(String availabilityZone) {
        setAvailabilityZone(availabilityZone);
        return this;
    }
    /**
     * 
     * The volume status.
     * 
     * 
     * @param volumeStatus
     *        The volume status.
     */
    public void setVolumeStatus(VolumeStatusInfo volumeStatus) {
        this.volumeStatus = volumeStatus;
    }
    /**
     * 
     * The volume status.
     * 
     * 
     * @return The volume status.
     */
    public VolumeStatusInfo getVolumeStatus() {
        return this.volumeStatus;
    }
    /**
     * 
     * The volume status.
     * 
     * 
     * @param volumeStatus
     *        The volume status.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */
    public VolumeStatusItem withVolumeStatus(VolumeStatusInfo volumeStatus) {
        setVolumeStatus(volumeStatus);
        return this;
    }
    /**
     * 
     * A list of events associated with the volume.
     * 
     * 
     * @return A list of events associated with the volume.
     */
    public java.util.List getEvents() {
        if (events == null) {
            events = new com.amazonaws.internal.SdkInternalList();
        }
        return events;
    }
    /**
     * 
     * A list of events associated with the volume.
     * 
     * 
     * @param events
     *        A list of events associated with the volume.
     */
    public void setEvents(java.util.Collection events) {
        if (events == null) {
            this.events = null;
            return;
        }
        this.events = new com.amazonaws.internal.SdkInternalList(
                events);
    }
    /**
     * 
     * A list of events associated with the volume.
     * 
     * 
     * NOTE: This method appends the values to the existing list (if
     * any). Use {@link #setEvents(java.util.Collection)} or
     * {@link #withEvents(java.util.Collection)} if you want to override the
     * existing values.
     * 
     * 
     * @param events
     *        A list of events associated with the volume.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */
    public VolumeStatusItem withEvents(VolumeStatusEvent... events) {
        if (this.events == null) {
            setEvents(new com.amazonaws.internal.SdkInternalList(
                    events.length));
        }
        for (VolumeStatusEvent ele : events) {
            this.events.add(ele);
        }
        return this;
    }
    /**
     * 
     * A list of events associated with the volume.
     * 
     * 
     * @param events
     *        A list of events associated with the volume.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */
    public VolumeStatusItem withEvents(
            java.util.Collection events) {
        setEvents(events);
        return this;
    }
    /**
     * 
     * The details of the operation.
     * 
     * 
     * @return The details of the operation.
     */
    public java.util.List getActions() {
        if (actions == null) {
            actions = new com.amazonaws.internal.SdkInternalList();
        }
        return actions;
    }
    /**
     * 
     * The details of the operation.
     * 
     * 
     * @param actions
     *        The details of the operation.
     */
    public void setActions(java.util.Collection actions) {
        if (actions == null) {
            this.actions = null;
            return;
        }
        this.actions = new com.amazonaws.internal.SdkInternalList(
                actions);
    }
    /**
     * 
     * The details of the operation.
     * 
     * 
     * NOTE: This method appends the values to the existing list (if
     * any). Use {@link #setActions(java.util.Collection)} or
     * {@link #withActions(java.util.Collection)} if you want to override the
     * existing values.
     * 
     * 
     * @param actions
     *        The details of the operation.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */
    public VolumeStatusItem withActions(VolumeStatusAction... actions) {
        if (this.actions == null) {
            setActions(new com.amazonaws.internal.SdkInternalList(
                    actions.length));
        }
        for (VolumeStatusAction ele : actions) {
            this.actions.add(ele);
        }
        return this;
    }
    /**
     * 
     * The details of the operation.
     * 
     * 
     * @param actions
     *        The details of the operation.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */
    public VolumeStatusItem withActions(
            java.util.Collection actions) {
        setActions(actions);
        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 (getVolumeId() != null)
            sb.append("VolumeId: " + getVolumeId() + ",");
        if (getAvailabilityZone() != null)
            sb.append("AvailabilityZone: " + getAvailabilityZone() + ",");
        if (getVolumeStatus() != null)
            sb.append("VolumeStatus: " + getVolumeStatus() + ",");
        if (getEvents() != null)
            sb.append("Events: " + getEvents() + ",");
        if (getActions() != null)
            sb.append("Actions: " + getActions());
        sb.append("}");
        return sb.toString();
    }
    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (obj instanceof VolumeStatusItem == false)
            return false;
        VolumeStatusItem other = (VolumeStatusItem) obj;
        if (other.getVolumeId() == null ^ this.getVolumeId() == null)
            return false;
        if (other.getVolumeId() != null
                && other.getVolumeId().equals(this.getVolumeId()) == false)
            return false;
        if (other.getAvailabilityZone() == null
                ^ this.getAvailabilityZone() == null)
            return false;
        if (other.getAvailabilityZone() != null
                && other.getAvailabilityZone().equals(
                        this.getAvailabilityZone()) == false)
            return false;
        if (other.getVolumeStatus() == null ^ this.getVolumeStatus() == null)
            return false;
        if (other.getVolumeStatus() != null
                && other.getVolumeStatus().equals(this.getVolumeStatus()) == false)
            return false;
        if (other.getEvents() == null ^ this.getEvents() == null)
            return false;
        if (other.getEvents() != null
                && other.getEvents().equals(this.getEvents()) == false)
            return false;
        if (other.getActions() == null ^ this.getActions() == null)
            return false;
        if (other.getActions() != null
                && other.getActions().equals(this.getActions()) == false)
            return false;
        return true;
    }
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        hashCode = prime * hashCode
                + ((getVolumeId() == null) ? 0 : getVolumeId().hashCode());
        hashCode = prime
                * hashCode
                + ((getAvailabilityZone() == null) ? 0 : getAvailabilityZone()
                        .hashCode());
        hashCode = prime
                * hashCode
                + ((getVolumeStatus() == null) ? 0 : getVolumeStatus()
                        .hashCode());
        hashCode = prime * hashCode
                + ((getEvents() == null) ? 0 : getEvents().hashCode());
        hashCode = prime * hashCode
                + ((getActions() == null) ? 0 : getActions().hashCode());
        return hashCode;
    }
    @Override
    public VolumeStatusItem clone() {
        try {
            return (VolumeStatusItem) super.clone();
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException(
                    "Got a CloneNotSupportedException from Object.clone() "
                            + "even though we're Cloneable!", e);
        }
    }
}