com.amazonaws.services.securityhub.model.AwsEc2VolumeDetails Maven / Gradle / Ivy
/*
* Copyright 2016-2021 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.securityhub.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Details about an EC2 volume.
*
*
* @see AWS
* API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class AwsEc2VolumeDetails implements Serializable, Cloneable, StructuredPojo {
/**
*
* Indicates when the volume was created.
*
*
* Uses the date-time
format specified in RFC
* 3339 section 5.6, Internet Date/Time Format. The value cannot contain spaces. For example,
* 2020-03-22T13:22:13.933Z
.
*
*/
private String createTime;
/**
*
* Whether the volume is encrypted.
*
*/
private Boolean encrypted;
/**
*
* The size of the volume, in GiBs.
*
*/
private Integer size;
/**
*
* The snapshot from which the volume was created.
*
*/
private String snapshotId;
/**
*
* The volume state.
*
*/
private String status;
/**
*
* The ARN of the AWS Key Management Service (AWS KMS) customer master key (CMK) that was used to protect the volume
* encryption key for the volume.
*
*/
private String kmsKeyId;
/**
*
* The volume attachments.
*
*/
private java.util.List attachments;
/**
*
* Indicates when the volume was created.
*
*
* Uses the date-time
format specified in RFC
* 3339 section 5.6, Internet Date/Time Format. The value cannot contain spaces. For example,
* 2020-03-22T13:22:13.933Z
.
*
*
* @param createTime
* Indicates when the volume was created.
*
* Uses the date-time
format specified in RFC 3339 section 5.6, Internet Date/Time
* Format. The value cannot contain spaces. For example, 2020-03-22T13:22:13.933Z
.
*/
public void setCreateTime(String createTime) {
this.createTime = createTime;
}
/**
*
* Indicates when the volume was created.
*
*
* Uses the date-time
format specified in RFC
* 3339 section 5.6, Internet Date/Time Format. The value cannot contain spaces. For example,
* 2020-03-22T13:22:13.933Z
.
*
*
* @return Indicates when the volume was created.
*
* Uses the date-time
format specified in RFC 3339 section 5.6, Internet Date/Time
* Format. The value cannot contain spaces. For example, 2020-03-22T13:22:13.933Z
.
*/
public String getCreateTime() {
return this.createTime;
}
/**
*
* Indicates when the volume was created.
*
*
* Uses the date-time
format specified in RFC
* 3339 section 5.6, Internet Date/Time Format. The value cannot contain spaces. For example,
* 2020-03-22T13:22:13.933Z
.
*
*
* @param createTime
* Indicates when the volume was created.
*
* Uses the date-time
format specified in RFC 3339 section 5.6, Internet Date/Time
* Format. The value cannot contain spaces. For example, 2020-03-22T13:22:13.933Z
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsEc2VolumeDetails withCreateTime(String createTime) {
setCreateTime(createTime);
return this;
}
/**
*
* Whether the volume is encrypted.
*
*
* @param encrypted
* Whether the volume is encrypted.
*/
public void setEncrypted(Boolean encrypted) {
this.encrypted = encrypted;
}
/**
*
* Whether the volume is encrypted.
*
*
* @return Whether the volume is encrypted.
*/
public Boolean getEncrypted() {
return this.encrypted;
}
/**
*
* Whether the volume is encrypted.
*
*
* @param encrypted
* Whether the volume is encrypted.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsEc2VolumeDetails withEncrypted(Boolean encrypted) {
setEncrypted(encrypted);
return this;
}
/**
*
* Whether the volume is encrypted.
*
*
* @return Whether the volume is encrypted.
*/
public Boolean isEncrypted() {
return this.encrypted;
}
/**
*
* The size of the volume, in GiBs.
*
*
* @param size
* The size of the volume, in GiBs.
*/
public void setSize(Integer size) {
this.size = size;
}
/**
*
* The size of the volume, in GiBs.
*
*
* @return The size of the volume, in GiBs.
*/
public Integer getSize() {
return this.size;
}
/**
*
* The size of the volume, in GiBs.
*
*
* @param size
* The size of the volume, in GiBs.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsEc2VolumeDetails withSize(Integer size) {
setSize(size);
return this;
}
/**
*
* The snapshot from which the volume was created.
*
*
* @param snapshotId
* The snapshot from which the volume was created.
*/
public void setSnapshotId(String snapshotId) {
this.snapshotId = snapshotId;
}
/**
*
* The snapshot from which the volume was created.
*
*
* @return The snapshot from which the volume was created.
*/
public String getSnapshotId() {
return this.snapshotId;
}
/**
*
* The snapshot from which the volume was created.
*
*
* @param snapshotId
* The snapshot from which the volume was created.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsEc2VolumeDetails withSnapshotId(String snapshotId) {
setSnapshotId(snapshotId);
return this;
}
/**
*
* The volume state.
*
*
* @param status
* The volume state.
*/
public void setStatus(String status) {
this.status = status;
}
/**
*
* The volume state.
*
*
* @return The volume state.
*/
public String getStatus() {
return this.status;
}
/**
*
* The volume state.
*
*
* @param status
* The volume state.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsEc2VolumeDetails withStatus(String status) {
setStatus(status);
return this;
}
/**
*
* The ARN of the AWS Key Management Service (AWS KMS) customer master key (CMK) that was used to protect the volume
* encryption key for the volume.
*
*
* @param kmsKeyId
* The ARN of the AWS Key Management Service (AWS KMS) customer master key (CMK) that was used to protect the
* volume encryption key for the volume.
*/
public void setKmsKeyId(String kmsKeyId) {
this.kmsKeyId = kmsKeyId;
}
/**
*
* The ARN of the AWS Key Management Service (AWS KMS) customer master key (CMK) that was used to protect the volume
* encryption key for the volume.
*
*
* @return The ARN of the AWS Key Management Service (AWS KMS) customer master key (CMK) that was used to protect
* the volume encryption key for the volume.
*/
public String getKmsKeyId() {
return this.kmsKeyId;
}
/**
*
* The ARN of the AWS Key Management Service (AWS KMS) customer master key (CMK) that was used to protect the volume
* encryption key for the volume.
*
*
* @param kmsKeyId
* The ARN of the AWS Key Management Service (AWS KMS) customer master key (CMK) that was used to protect the
* volume encryption key for the volume.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsEc2VolumeDetails withKmsKeyId(String kmsKeyId) {
setKmsKeyId(kmsKeyId);
return this;
}
/**
*
* The volume attachments.
*
*
* @return The volume attachments.
*/
public java.util.List getAttachments() {
return attachments;
}
/**
*
* The volume attachments.
*
*
* @param attachments
* The volume attachments.
*/
public void setAttachments(java.util.Collection attachments) {
if (attachments == null) {
this.attachments = null;
return;
}
this.attachments = new java.util.ArrayList(attachments);
}
/**
*
* The volume attachments.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setAttachments(java.util.Collection)} or {@link #withAttachments(java.util.Collection)} if you want to
* override the existing values.
*
*
* @param attachments
* The volume attachments.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsEc2VolumeDetails withAttachments(AwsEc2VolumeAttachment... attachments) {
if (this.attachments == null) {
setAttachments(new java.util.ArrayList(attachments.length));
}
for (AwsEc2VolumeAttachment ele : attachments) {
this.attachments.add(ele);
}
return this;
}
/**
*
* The volume attachments.
*
*
* @param attachments
* The volume attachments.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsEc2VolumeDetails withAttachments(java.util.Collection attachments) {
setAttachments(attachments);
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 (getCreateTime() != null)
sb.append("CreateTime: ").append(getCreateTime()).append(",");
if (getEncrypted() != null)
sb.append("Encrypted: ").append(getEncrypted()).append(",");
if (getSize() != null)
sb.append("Size: ").append(getSize()).append(",");
if (getSnapshotId() != null)
sb.append("SnapshotId: ").append(getSnapshotId()).append(",");
if (getStatus() != null)
sb.append("Status: ").append(getStatus()).append(",");
if (getKmsKeyId() != null)
sb.append("KmsKeyId: ").append(getKmsKeyId()).append(",");
if (getAttachments() != null)
sb.append("Attachments: ").append(getAttachments());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof AwsEc2VolumeDetails == false)
return false;
AwsEc2VolumeDetails other = (AwsEc2VolumeDetails) obj;
if (other.getCreateTime() == null ^ this.getCreateTime() == null)
return false;
if (other.getCreateTime() != null && other.getCreateTime().equals(this.getCreateTime()) == false)
return false;
if (other.getEncrypted() == null ^ this.getEncrypted() == null)
return false;
if (other.getEncrypted() != null && other.getEncrypted().equals(this.getEncrypted()) == false)
return false;
if (other.getSize() == null ^ this.getSize() == null)
return false;
if (other.getSize() != null && other.getSize().equals(this.getSize()) == false)
return false;
if (other.getSnapshotId() == null ^ this.getSnapshotId() == null)
return false;
if (other.getSnapshotId() != null && other.getSnapshotId().equals(this.getSnapshotId()) == false)
return false;
if (other.getStatus() == null ^ this.getStatus() == null)
return false;
if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == false)
return false;
if (other.getKmsKeyId() == null ^ this.getKmsKeyId() == null)
return false;
if (other.getKmsKeyId() != null && other.getKmsKeyId().equals(this.getKmsKeyId()) == false)
return false;
if (other.getAttachments() == null ^ this.getAttachments() == null)
return false;
if (other.getAttachments() != null && other.getAttachments().equals(this.getAttachments()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
hashCode = prime * hashCode + ((getEncrypted() == null) ? 0 : getEncrypted().hashCode());
hashCode = prime * hashCode + ((getSize() == null) ? 0 : getSize().hashCode());
hashCode = prime * hashCode + ((getSnapshotId() == null) ? 0 : getSnapshotId().hashCode());
hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode());
hashCode = prime * hashCode + ((getKmsKeyId() == null) ? 0 : getKmsKeyId().hashCode());
hashCode = prime * hashCode + ((getAttachments() == null) ? 0 : getAttachments().hashCode());
return hashCode;
}
@Override
public AwsEc2VolumeDetails clone() {
try {
return (AwsEc2VolumeDetails) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.securityhub.model.transform.AwsEc2VolumeDetailsMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}