/* * Copyright 2018-2023 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.batch.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* Specifies an Amazon EKS volume for a job definition. *
* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class EksVolume implements Serializable, Cloneable, StructuredPojo { /** ** The name of the volume. The name must be allowed as a DNS subdomain name. For more information, see DNS subdomain * names in the Kubernetes documentation. *
*/ private String name; /** *
* Specifies the configuration of a Kubernetes hostPath
volume. For more information, see hostPath in the Kubernetes
* documentation.
*
* Specifies the configuration of a Kubernetes emptyDir
volume. For more information, see emptyDir in the Kubernetes
* documentation.
*
* Specifies the configuration of a Kubernetes secret
volume. For more information, see secret in the Kubernetes
* documentation.
*
* The name of the volume. The name must be allowed as a DNS subdomain name. For more information, see DNS subdomain * names in the Kubernetes documentation. *
* * @param name * The name of the volume. The name must be allowed as a DNS subdomain name. For more information, see DNS * subdomain names in the Kubernetes documentation. */ public void setName(String name) { this.name = name; } /** ** The name of the volume. The name must be allowed as a DNS subdomain name. For more information, see DNS subdomain * names in the Kubernetes documentation. *
* * @return The name of the volume. The name must be allowed as a DNS subdomain name. For more information, see DNS * subdomain names in the Kubernetes documentation. */ public String getName() { return this.name; } /** ** The name of the volume. The name must be allowed as a DNS subdomain name. For more information, see DNS subdomain * names in the Kubernetes documentation. *
* * @param name * The name of the volume. The name must be allowed as a DNS subdomain name. For more information, see DNS * subdomain names in the Kubernetes documentation. * @return Returns a reference to this object so that method calls can be chained together. */ public EksVolume withName(String name) { setName(name); return this; } /** *
* Specifies the configuration of a Kubernetes hostPath
volume. For more information, see hostPath in the Kubernetes
* documentation.
*
hostPath
volume. For more information, see hostPath in the Kubernetes
* documentation.
*/
public void setHostPath(EksHostPath hostPath) {
this.hostPath = hostPath;
}
/**
*
* Specifies the configuration of a Kubernetes hostPath
volume. For more information, see hostPath in the Kubernetes
* documentation.
*
hostPath
volume. For more information, see hostPath in the Kubernetes
* documentation.
*/
public EksHostPath getHostPath() {
return this.hostPath;
}
/**
*
* Specifies the configuration of a Kubernetes hostPath
volume. For more information, see hostPath in the Kubernetes
* documentation.
*
hostPath
volume. For more information, see hostPath in the Kubernetes
* documentation.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public EksVolume withHostPath(EksHostPath hostPath) {
setHostPath(hostPath);
return this;
}
/**
*
* Specifies the configuration of a Kubernetes emptyDir
volume. For more information, see emptyDir in the Kubernetes
* documentation.
*
emptyDir
volume. For more information, see emptyDir in the Kubernetes
* documentation.
*/
public void setEmptyDir(EksEmptyDir emptyDir) {
this.emptyDir = emptyDir;
}
/**
*
* Specifies the configuration of a Kubernetes emptyDir
volume. For more information, see emptyDir in the Kubernetes
* documentation.
*
emptyDir
volume. For more information, see emptyDir in the Kubernetes
* documentation.
*/
public EksEmptyDir getEmptyDir() {
return this.emptyDir;
}
/**
*
* Specifies the configuration of a Kubernetes emptyDir
volume. For more information, see emptyDir in the Kubernetes
* documentation.
*
emptyDir
volume. For more information, see emptyDir in the Kubernetes
* documentation.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public EksVolume withEmptyDir(EksEmptyDir emptyDir) {
setEmptyDir(emptyDir);
return this;
}
/**
*
* Specifies the configuration of a Kubernetes secret
volume. For more information, see secret in the Kubernetes
* documentation.
*
secret
volume. For more information, see secret in the Kubernetes
* documentation.
*/
public void setSecret(EksSecret secret) {
this.secret = secret;
}
/**
*
* Specifies the configuration of a Kubernetes secret
volume. For more information, see secret in the Kubernetes
* documentation.
*
secret
volume. For more information, see secret in the Kubernetes
* documentation.
*/
public EksSecret getSecret() {
return this.secret;
}
/**
*
* Specifies the configuration of a Kubernetes secret
volume. For more information, see secret in the Kubernetes
* documentation.
*
secret
volume. For more information, see secret in the Kubernetes
* documentation.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public EksVolume withSecret(EksSecret secret) {
setSecret(secret);
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 (getName() != null)
sb.append("Name: ").append(getName()).append(",");
if (getHostPath() != null)
sb.append("HostPath: ").append(getHostPath()).append(",");
if (getEmptyDir() != null)
sb.append("EmptyDir: ").append(getEmptyDir()).append(",");
if (getSecret() != null)
sb.append("Secret: ").append(getSecret());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof EksVolume == false)
return false;
EksVolume other = (EksVolume) obj;
if (other.getName() == null ^ this.getName() == null)
return false;
if (other.getName() != null && other.getName().equals(this.getName()) == false)
return false;
if (other.getHostPath() == null ^ this.getHostPath() == null)
return false;
if (other.getHostPath() != null && other.getHostPath().equals(this.getHostPath()) == false)
return false;
if (other.getEmptyDir() == null ^ this.getEmptyDir() == null)
return false;
if (other.getEmptyDir() != null && other.getEmptyDir().equals(this.getEmptyDir()) == false)
return false;
if (other.getSecret() == null ^ this.getSecret() == null)
return false;
if (other.getSecret() != null && other.getSecret().equals(this.getSecret()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode());
hashCode = prime * hashCode + ((getHostPath() == null) ? 0 : getHostPath().hashCode());
hashCode = prime * hashCode + ((getEmptyDir() == null) ? 0 : getEmptyDir().hashCode());
hashCode = prime * hashCode + ((getSecret() == null) ? 0 : getSecret().hashCode());
return hashCode;
}
@Override
public EksVolume clone() {
try {
return (EksVolume) 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.batch.model.transform.EksVolumeMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}