com.amazonaws.services.ec2.model.VolumeModification Maven / Gradle / Ivy
Show all versions of aws-java-sdk-ec2 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.ec2.model;
import java.io.Serializable;
import javax.annotation.Generated;
/**
*
* Describes the modification status of an EBS volume.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class VolumeModification implements Serializable, Cloneable {
/**
*
* The ID of the volume.
*
*/
private String volumeId;
/**
*
* The current modification state.
*
*/
private String modificationState;
/**
*
* A status message about the modification progress or failure.
*
*/
private String statusMessage;
/**
*
* The target size of the volume, in GiB.
*
*/
private Integer targetSize;
/**
*
* The target IOPS rate of the volume.
*
*/
private Integer targetIops;
/**
*
* The target EBS volume type of the volume.
*
*/
private String targetVolumeType;
/**
*
* The target throughput of the volume, in MiB/s.
*
*/
private Integer targetThroughput;
/**
*
* The target setting for Amazon EBS Multi-Attach.
*
*/
private Boolean targetMultiAttachEnabled;
/**
*
* The original size of the volume, in GiB.
*
*/
private Integer originalSize;
/**
*
* The original IOPS rate of the volume.
*
*/
private Integer originalIops;
/**
*
* The original EBS volume type of the volume.
*
*/
private String originalVolumeType;
/**
*
* The original throughput of the volume, in MiB/s.
*
*/
private Integer originalThroughput;
/**
*
* The original setting for Amazon EBS Multi-Attach.
*
*/
private Boolean originalMultiAttachEnabled;
/**
*
* The modification progress, from 0 to 100 percent complete.
*
*/
private Long progress;
/**
*
* The modification start time.
*
*/
private java.util.Date startTime;
/**
*
* The modification completion or failure time.
*
*/
private java.util.Date endTime;
/**
*
* The ID of the volume.
*
*
* @param volumeId
* The ID of the volume.
*/
public void setVolumeId(String volumeId) {
this.volumeId = volumeId;
}
/**
*
* The ID of the volume.
*
*
* @return The ID of the volume.
*/
public String getVolumeId() {
return this.volumeId;
}
/**
*
* The ID of the volume.
*
*
* @param volumeId
* The ID of the volume.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public VolumeModification withVolumeId(String volumeId) {
setVolumeId(volumeId);
return this;
}
/**
*
* The current modification state.
*
*
* @param modificationState
* The current modification state.
* @see VolumeModificationState
*/
public void setModificationState(String modificationState) {
this.modificationState = modificationState;
}
/**
*
* The current modification state.
*
*
* @return The current modification state.
* @see VolumeModificationState
*/
public String getModificationState() {
return this.modificationState;
}
/**
*
* The current modification state.
*
*
* @param modificationState
* The current modification state.
* @return Returns a reference to this object so that method calls can be chained together.
* @see VolumeModificationState
*/
public VolumeModification withModificationState(String modificationState) {
setModificationState(modificationState);
return this;
}
/**
*
* The current modification state.
*
*
* @param modificationState
* The current modification state.
* @see VolumeModificationState
*/
public void setModificationState(VolumeModificationState modificationState) {
withModificationState(modificationState);
}
/**
*
* The current modification state.
*
*
* @param modificationState
* The current modification state.
* @return Returns a reference to this object so that method calls can be chained together.
* @see VolumeModificationState
*/
public VolumeModification withModificationState(VolumeModificationState modificationState) {
this.modificationState = modificationState.toString();
return this;
}
/**
*
* A status message about the modification progress or failure.
*
*
* @param statusMessage
* A status message about the modification progress or failure.
*/
public void setStatusMessage(String statusMessage) {
this.statusMessage = statusMessage;
}
/**
*
* A status message about the modification progress or failure.
*
*
* @return A status message about the modification progress or failure.
*/
public String getStatusMessage() {
return this.statusMessage;
}
/**
*
* A status message about the modification progress or failure.
*
*
* @param statusMessage
* A status message about the modification progress or failure.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public VolumeModification withStatusMessage(String statusMessage) {
setStatusMessage(statusMessage);
return this;
}
/**
*
* The target size of the volume, in GiB.
*
*
* @param targetSize
* The target size of the volume, in GiB.
*/
public void setTargetSize(Integer targetSize) {
this.targetSize = targetSize;
}
/**
*
* The target size of the volume, in GiB.
*
*
* @return The target size of the volume, in GiB.
*/
public Integer getTargetSize() {
return this.targetSize;
}
/**
*
* The target size of the volume, in GiB.
*
*
* @param targetSize
* The target size of the volume, in GiB.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public VolumeModification withTargetSize(Integer targetSize) {
setTargetSize(targetSize);
return this;
}
/**
*
* The target IOPS rate of the volume.
*
*
* @param targetIops
* The target IOPS rate of the volume.
*/
public void setTargetIops(Integer targetIops) {
this.targetIops = targetIops;
}
/**
*
* The target IOPS rate of the volume.
*
*
* @return The target IOPS rate of the volume.
*/
public Integer getTargetIops() {
return this.targetIops;
}
/**
*
* The target IOPS rate of the volume.
*
*
* @param targetIops
* The target IOPS rate of the volume.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public VolumeModification withTargetIops(Integer targetIops) {
setTargetIops(targetIops);
return this;
}
/**
*
* The target EBS volume type of the volume.
*
*
* @param targetVolumeType
* The target EBS volume type of the volume.
* @see VolumeType
*/
public void setTargetVolumeType(String targetVolumeType) {
this.targetVolumeType = targetVolumeType;
}
/**
*
* The target EBS volume type of the volume.
*
*
* @return The target EBS volume type of the volume.
* @see VolumeType
*/
public String getTargetVolumeType() {
return this.targetVolumeType;
}
/**
*
* The target EBS volume type of the volume.
*
*
* @param targetVolumeType
* The target EBS volume type of the volume.
* @return Returns a reference to this object so that method calls can be chained together.
* @see VolumeType
*/
public VolumeModification withTargetVolumeType(String targetVolumeType) {
setTargetVolumeType(targetVolumeType);
return this;
}
/**
*
* The target EBS volume type of the volume.
*
*
* @param targetVolumeType
* The target EBS volume type of the volume.
* @see VolumeType
*/
public void setTargetVolumeType(VolumeType targetVolumeType) {
withTargetVolumeType(targetVolumeType);
}
/**
*
* The target EBS volume type of the volume.
*
*
* @param targetVolumeType
* The target EBS volume type of the volume.
* @return Returns a reference to this object so that method calls can be chained together.
* @see VolumeType
*/
public VolumeModification withTargetVolumeType(VolumeType targetVolumeType) {
this.targetVolumeType = targetVolumeType.toString();
return this;
}
/**
*
* The target throughput of the volume, in MiB/s.
*
*
* @param targetThroughput
* The target throughput of the volume, in MiB/s.
*/
public void setTargetThroughput(Integer targetThroughput) {
this.targetThroughput = targetThroughput;
}
/**
*
* The target throughput of the volume, in MiB/s.
*
*
* @return The target throughput of the volume, in MiB/s.
*/
public Integer getTargetThroughput() {
return this.targetThroughput;
}
/**
*
* The target throughput of the volume, in MiB/s.
*
*
* @param targetThroughput
* The target throughput of the volume, in MiB/s.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public VolumeModification withTargetThroughput(Integer targetThroughput) {
setTargetThroughput(targetThroughput);
return this;
}
/**
*
* The target setting for Amazon EBS Multi-Attach.
*
*
* @param targetMultiAttachEnabled
* The target setting for Amazon EBS Multi-Attach.
*/
public void setTargetMultiAttachEnabled(Boolean targetMultiAttachEnabled) {
this.targetMultiAttachEnabled = targetMultiAttachEnabled;
}
/**
*
* The target setting for Amazon EBS Multi-Attach.
*
*
* @return The target setting for Amazon EBS Multi-Attach.
*/
public Boolean getTargetMultiAttachEnabled() {
return this.targetMultiAttachEnabled;
}
/**
*
* The target setting for Amazon EBS Multi-Attach.
*
*
* @param targetMultiAttachEnabled
* The target setting for Amazon EBS Multi-Attach.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public VolumeModification withTargetMultiAttachEnabled(Boolean targetMultiAttachEnabled) {
setTargetMultiAttachEnabled(targetMultiAttachEnabled);
return this;
}
/**
*
* The target setting for Amazon EBS Multi-Attach.
*
*
* @return The target setting for Amazon EBS Multi-Attach.
*/
public Boolean isTargetMultiAttachEnabled() {
return this.targetMultiAttachEnabled;
}
/**
*
* The original size of the volume, in GiB.
*
*
* @param originalSize
* The original size of the volume, in GiB.
*/
public void setOriginalSize(Integer originalSize) {
this.originalSize = originalSize;
}
/**
*
* The original size of the volume, in GiB.
*
*
* @return The original size of the volume, in GiB.
*/
public Integer getOriginalSize() {
return this.originalSize;
}
/**
*
* The original size of the volume, in GiB.
*
*
* @param originalSize
* The original size of the volume, in GiB.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public VolumeModification withOriginalSize(Integer originalSize) {
setOriginalSize(originalSize);
return this;
}
/**
*
* The original IOPS rate of the volume.
*
*
* @param originalIops
* The original IOPS rate of the volume.
*/
public void setOriginalIops(Integer originalIops) {
this.originalIops = originalIops;
}
/**
*
* The original IOPS rate of the volume.
*
*
* @return The original IOPS rate of the volume.
*/
public Integer getOriginalIops() {
return this.originalIops;
}
/**
*
* The original IOPS rate of the volume.
*
*
* @param originalIops
* The original IOPS rate of the volume.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public VolumeModification withOriginalIops(Integer originalIops) {
setOriginalIops(originalIops);
return this;
}
/**
*
* The original EBS volume type of the volume.
*
*
* @param originalVolumeType
* The original EBS volume type of the volume.
* @see VolumeType
*/
public void setOriginalVolumeType(String originalVolumeType) {
this.originalVolumeType = originalVolumeType;
}
/**
*
* The original EBS volume type of the volume.
*
*
* @return The original EBS volume type of the volume.
* @see VolumeType
*/
public String getOriginalVolumeType() {
return this.originalVolumeType;
}
/**
*
* The original EBS volume type of the volume.
*
*
* @param originalVolumeType
* The original EBS volume type of the volume.
* @return Returns a reference to this object so that method calls can be chained together.
* @see VolumeType
*/
public VolumeModification withOriginalVolumeType(String originalVolumeType) {
setOriginalVolumeType(originalVolumeType);
return this;
}
/**
*
* The original EBS volume type of the volume.
*
*
* @param originalVolumeType
* The original EBS volume type of the volume.
* @see VolumeType
*/
public void setOriginalVolumeType(VolumeType originalVolumeType) {
withOriginalVolumeType(originalVolumeType);
}
/**
*
* The original EBS volume type of the volume.
*
*
* @param originalVolumeType
* The original EBS volume type of the volume.
* @return Returns a reference to this object so that method calls can be chained together.
* @see VolumeType
*/
public VolumeModification withOriginalVolumeType(VolumeType originalVolumeType) {
this.originalVolumeType = originalVolumeType.toString();
return this;
}
/**
*
* The original throughput of the volume, in MiB/s.
*
*
* @param originalThroughput
* The original throughput of the volume, in MiB/s.
*/
public void setOriginalThroughput(Integer originalThroughput) {
this.originalThroughput = originalThroughput;
}
/**
*
* The original throughput of the volume, in MiB/s.
*
*
* @return The original throughput of the volume, in MiB/s.
*/
public Integer getOriginalThroughput() {
return this.originalThroughput;
}
/**
*
* The original throughput of the volume, in MiB/s.
*
*
* @param originalThroughput
* The original throughput of the volume, in MiB/s.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public VolumeModification withOriginalThroughput(Integer originalThroughput) {
setOriginalThroughput(originalThroughput);
return this;
}
/**
*
* The original setting for Amazon EBS Multi-Attach.
*
*
* @param originalMultiAttachEnabled
* The original setting for Amazon EBS Multi-Attach.
*/
public void setOriginalMultiAttachEnabled(Boolean originalMultiAttachEnabled) {
this.originalMultiAttachEnabled = originalMultiAttachEnabled;
}
/**
*
* The original setting for Amazon EBS Multi-Attach.
*
*
* @return The original setting for Amazon EBS Multi-Attach.
*/
public Boolean getOriginalMultiAttachEnabled() {
return this.originalMultiAttachEnabled;
}
/**
*
* The original setting for Amazon EBS Multi-Attach.
*
*
* @param originalMultiAttachEnabled
* The original setting for Amazon EBS Multi-Attach.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public VolumeModification withOriginalMultiAttachEnabled(Boolean originalMultiAttachEnabled) {
setOriginalMultiAttachEnabled(originalMultiAttachEnabled);
return this;
}
/**
*
* The original setting for Amazon EBS Multi-Attach.
*
*
* @return The original setting for Amazon EBS Multi-Attach.
*/
public Boolean isOriginalMultiAttachEnabled() {
return this.originalMultiAttachEnabled;
}
/**
*
* The modification progress, from 0 to 100 percent complete.
*
*
* @param progress
* The modification progress, from 0 to 100 percent complete.
*/
public void setProgress(Long progress) {
this.progress = progress;
}
/**
*
* The modification progress, from 0 to 100 percent complete.
*
*
* @return The modification progress, from 0 to 100 percent complete.
*/
public Long getProgress() {
return this.progress;
}
/**
*
* The modification progress, from 0 to 100 percent complete.
*
*
* @param progress
* The modification progress, from 0 to 100 percent complete.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public VolumeModification withProgress(Long progress) {
setProgress(progress);
return this;
}
/**
*
* The modification start time.
*
*
* @param startTime
* The modification start time.
*/
public void setStartTime(java.util.Date startTime) {
this.startTime = startTime;
}
/**
*
* The modification start time.
*
*
* @return The modification start time.
*/
public java.util.Date getStartTime() {
return this.startTime;
}
/**
*
* The modification start time.
*
*
* @param startTime
* The modification start time.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public VolumeModification withStartTime(java.util.Date startTime) {
setStartTime(startTime);
return this;
}
/**
*
* The modification completion or failure time.
*
*
* @param endTime
* The modification completion or failure time.
*/
public void setEndTime(java.util.Date endTime) {
this.endTime = endTime;
}
/**
*
* The modification completion or failure time.
*
*
* @return The modification completion or failure time.
*/
public java.util.Date getEndTime() {
return this.endTime;
}
/**
*
* The modification completion or failure time.
*
*
* @param endTime
* The modification completion or failure time.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public VolumeModification withEndTime(java.util.Date endTime) {
setEndTime(endTime);
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 (getVolumeId() != null)
sb.append("VolumeId: ").append(getVolumeId()).append(",");
if (getModificationState() != null)
sb.append("ModificationState: ").append(getModificationState()).append(",");
if (getStatusMessage() != null)
sb.append("StatusMessage: ").append(getStatusMessage()).append(",");
if (getTargetSize() != null)
sb.append("TargetSize: ").append(getTargetSize()).append(",");
if (getTargetIops() != null)
sb.append("TargetIops: ").append(getTargetIops()).append(",");
if (getTargetVolumeType() != null)
sb.append("TargetVolumeType: ").append(getTargetVolumeType()).append(",");
if (getTargetThroughput() != null)
sb.append("TargetThroughput: ").append(getTargetThroughput()).append(",");
if (getTargetMultiAttachEnabled() != null)
sb.append("TargetMultiAttachEnabled: ").append(getTargetMultiAttachEnabled()).append(",");
if (getOriginalSize() != null)
sb.append("OriginalSize: ").append(getOriginalSize()).append(",");
if (getOriginalIops() != null)
sb.append("OriginalIops: ").append(getOriginalIops()).append(",");
if (getOriginalVolumeType() != null)
sb.append("OriginalVolumeType: ").append(getOriginalVolumeType()).append(",");
if (getOriginalThroughput() != null)
sb.append("OriginalThroughput: ").append(getOriginalThroughput()).append(",");
if (getOriginalMultiAttachEnabled() != null)
sb.append("OriginalMultiAttachEnabled: ").append(getOriginalMultiAttachEnabled()).append(",");
if (getProgress() != null)
sb.append("Progress: ").append(getProgress()).append(",");
if (getStartTime() != null)
sb.append("StartTime: ").append(getStartTime()).append(",");
if (getEndTime() != null)
sb.append("EndTime: ").append(getEndTime());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof VolumeModification == false)
return false;
VolumeModification other = (VolumeModification) obj;
if (other.getVolumeId() == null ^ this.getVolumeId() == null)
return false;
if (other.getVolumeId() != null && other.getVolumeId().equals(this.getVolumeId()) == false)
return false;
if (other.getModificationState() == null ^ this.getModificationState() == null)
return false;
if (other.getModificationState() != null && other.getModificationState().equals(this.getModificationState()) == false)
return false;
if (other.getStatusMessage() == null ^ this.getStatusMessage() == null)
return false;
if (other.getStatusMessage() != null && other.getStatusMessage().equals(this.getStatusMessage()) == false)
return false;
if (other.getTargetSize() == null ^ this.getTargetSize() == null)
return false;
if (other.getTargetSize() != null && other.getTargetSize().equals(this.getTargetSize()) == false)
return false;
if (other.getTargetIops() == null ^ this.getTargetIops() == null)
return false;
if (other.getTargetIops() != null && other.getTargetIops().equals(this.getTargetIops()) == false)
return false;
if (other.getTargetVolumeType() == null ^ this.getTargetVolumeType() == null)
return false;
if (other.getTargetVolumeType() != null && other.getTargetVolumeType().equals(this.getTargetVolumeType()) == false)
return false;
if (other.getTargetThroughput() == null ^ this.getTargetThroughput() == null)
return false;
if (other.getTargetThroughput() != null && other.getTargetThroughput().equals(this.getTargetThroughput()) == false)
return false;
if (other.getTargetMultiAttachEnabled() == null ^ this.getTargetMultiAttachEnabled() == null)
return false;
if (other.getTargetMultiAttachEnabled() != null && other.getTargetMultiAttachEnabled().equals(this.getTargetMultiAttachEnabled()) == false)
return false;
if (other.getOriginalSize() == null ^ this.getOriginalSize() == null)
return false;
if (other.getOriginalSize() != null && other.getOriginalSize().equals(this.getOriginalSize()) == false)
return false;
if (other.getOriginalIops() == null ^ this.getOriginalIops() == null)
return false;
if (other.getOriginalIops() != null && other.getOriginalIops().equals(this.getOriginalIops()) == false)
return false;
if (other.getOriginalVolumeType() == null ^ this.getOriginalVolumeType() == null)
return false;
if (other.getOriginalVolumeType() != null && other.getOriginalVolumeType().equals(this.getOriginalVolumeType()) == false)
return false;
if (other.getOriginalThroughput() == null ^ this.getOriginalThroughput() == null)
return false;
if (other.getOriginalThroughput() != null && other.getOriginalThroughput().equals(this.getOriginalThroughput()) == false)
return false;
if (other.getOriginalMultiAttachEnabled() == null ^ this.getOriginalMultiAttachEnabled() == null)
return false;
if (other.getOriginalMultiAttachEnabled() != null && other.getOriginalMultiAttachEnabled().equals(this.getOriginalMultiAttachEnabled()) == false)
return false;
if (other.getProgress() == null ^ this.getProgress() == null)
return false;
if (other.getProgress() != null && other.getProgress().equals(this.getProgress()) == false)
return false;
if (other.getStartTime() == null ^ this.getStartTime() == null)
return false;
if (other.getStartTime() != null && other.getStartTime().equals(this.getStartTime()) == false)
return false;
if (other.getEndTime() == null ^ this.getEndTime() == null)
return false;
if (other.getEndTime() != null && other.getEndTime().equals(this.getEndTime()) == 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 + ((getModificationState() == null) ? 0 : getModificationState().hashCode());
hashCode = prime * hashCode + ((getStatusMessage() == null) ? 0 : getStatusMessage().hashCode());
hashCode = prime * hashCode + ((getTargetSize() == null) ? 0 : getTargetSize().hashCode());
hashCode = prime * hashCode + ((getTargetIops() == null) ? 0 : getTargetIops().hashCode());
hashCode = prime * hashCode + ((getTargetVolumeType() == null) ? 0 : getTargetVolumeType().hashCode());
hashCode = prime * hashCode + ((getTargetThroughput() == null) ? 0 : getTargetThroughput().hashCode());
hashCode = prime * hashCode + ((getTargetMultiAttachEnabled() == null) ? 0 : getTargetMultiAttachEnabled().hashCode());
hashCode = prime * hashCode + ((getOriginalSize() == null) ? 0 : getOriginalSize().hashCode());
hashCode = prime * hashCode + ((getOriginalIops() == null) ? 0 : getOriginalIops().hashCode());
hashCode = prime * hashCode + ((getOriginalVolumeType() == null) ? 0 : getOriginalVolumeType().hashCode());
hashCode = prime * hashCode + ((getOriginalThroughput() == null) ? 0 : getOriginalThroughput().hashCode());
hashCode = prime * hashCode + ((getOriginalMultiAttachEnabled() == null) ? 0 : getOriginalMultiAttachEnabled().hashCode());
hashCode = prime * hashCode + ((getProgress() == null) ? 0 : getProgress().hashCode());
hashCode = prime * hashCode + ((getStartTime() == null) ? 0 : getStartTime().hashCode());
hashCode = prime * hashCode + ((getEndTime() == null) ? 0 : getEndTime().hashCode());
return hashCode;
}
@Override
public VolumeModification clone() {
try {
return (VolumeModification) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}