![JAR search and dependency download from the Maven repository](/logo.png)
org.cdk8s.plus.DeploymentSpec Maven / Gradle / Ivy
Show all versions of cdk8s-plus Show documentation
package org.cdk8s.plus;
/**
* Properties for initialization of `DeploymentSpec`.
*
* EXPERIMENTAL
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.7.0 (build 179a3a5)", date = "2020-06-29T13:29:38.489Z")
@software.amazon.jsii.Jsii(module = org.cdk8s.plus.$Module.class, fqn = "cdk8s-plus.DeploymentSpec")
@software.amazon.jsii.Jsii.Proxy(DeploymentSpec.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public interface DeploymentSpec extends software.amazon.jsii.JsiiSerializable {
/**
* Template for pod metadata.
*
* EXPERIMENTAL
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable org.cdk8s.ApiObjectMetadata getPodMetadataTemplate() {
return null;
}
/**
* Template for pod specs.
*
* EXPERIMENTAL
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable org.cdk8s.plus.PodSpec getPodSpecTemplate() {
return null;
}
/**
* Number of desired pods.
*
* Default: 1
*
* EXPERIMENTAL
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.Number getReplicas() {
return null;
}
/**
* @return a {@link Builder} of {@link DeploymentSpec}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link DeploymentSpec}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
private org.cdk8s.ApiObjectMetadata podMetadataTemplate;
private org.cdk8s.plus.PodSpec podSpecTemplate;
private java.lang.Number replicas;
/**
* Sets the value of {@link DeploymentSpec#getPodMetadataTemplate}
* @param podMetadataTemplate Template for pod metadata.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder podMetadataTemplate(org.cdk8s.ApiObjectMetadata podMetadataTemplate) {
this.podMetadataTemplate = podMetadataTemplate;
return this;
}
/**
* Sets the value of {@link DeploymentSpec#getPodSpecTemplate}
* @param podSpecTemplate Template for pod specs.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder podSpecTemplate(org.cdk8s.plus.PodSpec podSpecTemplate) {
this.podSpecTemplate = podSpecTemplate;
return this;
}
/**
* Sets the value of {@link DeploymentSpec#getReplicas}
* @param replicas Number of desired pods.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder replicas(java.lang.Number replicas) {
this.replicas = replicas;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link DeploymentSpec}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public DeploymentSpec build() {
return new Jsii$Proxy(podMetadataTemplate, podSpecTemplate, replicas);
}
}
/**
* An implementation for {@link DeploymentSpec}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements DeploymentSpec {
private final org.cdk8s.ApiObjectMetadata podMetadataTemplate;
private final org.cdk8s.plus.PodSpec podSpecTemplate;
private final java.lang.Number replicas;
/**
* Constructor that initializes the object based on values retrieved from the JsiiObject.
* @param objRef Reference to the JSII managed object.
*/
protected Jsii$Proxy(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
this.podMetadataTemplate = this.jsiiGet("podMetadataTemplate", org.cdk8s.ApiObjectMetadata.class);
this.podSpecTemplate = this.jsiiGet("podSpecTemplate", org.cdk8s.plus.PodSpec.class);
this.replicas = this.jsiiGet("replicas", java.lang.Number.class);
}
/**
* Constructor that initializes the object based on literal property values passed by the {@link Builder}.
*/
private Jsii$Proxy(final org.cdk8s.ApiObjectMetadata podMetadataTemplate, final org.cdk8s.plus.PodSpec podSpecTemplate, final java.lang.Number replicas) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
this.podMetadataTemplate = podMetadataTemplate;
this.podSpecTemplate = podSpecTemplate;
this.replicas = replicas;
}
@Override
public org.cdk8s.ApiObjectMetadata getPodMetadataTemplate() {
return this.podMetadataTemplate;
}
@Override
public org.cdk8s.plus.PodSpec getPodSpecTemplate() {
return this.podSpecTemplate;
}
@Override
public java.lang.Number getReplicas() {
return this.replicas;
}
@Override
public com.fasterxml.jackson.databind.JsonNode $jsii$toJson() {
final com.fasterxml.jackson.databind.ObjectMapper om = software.amazon.jsii.JsiiObjectMapper.INSTANCE;
final com.fasterxml.jackson.databind.node.ObjectNode data = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
if (this.getPodMetadataTemplate() != null) {
data.set("podMetadataTemplate", om.valueToTree(this.getPodMetadataTemplate()));
}
if (this.getPodSpecTemplate() != null) {
data.set("podSpecTemplate", om.valueToTree(this.getPodSpecTemplate()));
}
if (this.getReplicas() != null) {
data.set("replicas", om.valueToTree(this.getReplicas()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("cdk8s-plus.DeploymentSpec"));
struct.set("data", data);
final com.fasterxml.jackson.databind.node.ObjectNode obj = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
obj.set("$jsii.struct", struct);
return obj;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
DeploymentSpec.Jsii$Proxy that = (DeploymentSpec.Jsii$Proxy) o;
if (this.podMetadataTemplate != null ? !this.podMetadataTemplate.equals(that.podMetadataTemplate) : that.podMetadataTemplate != null) return false;
if (this.podSpecTemplate != null ? !this.podSpecTemplate.equals(that.podSpecTemplate) : that.podSpecTemplate != null) return false;
return this.replicas != null ? this.replicas.equals(that.replicas) : that.replicas == null;
}
@Override
public int hashCode() {
int result = this.podMetadataTemplate != null ? this.podMetadataTemplate.hashCode() : 0;
result = 31 * result + (this.podSpecTemplate != null ? this.podSpecTemplate.hashCode() : 0);
result = 31 * result + (this.replicas != null ? this.replicas.hashCode() : 0);
return result;
}
}
}