
org.cdk8s.plus31.StatefulSetProps Maven / Gradle / Ivy
package org.cdk8s.plus31;
/**
* Properties for initialization of StatefulSet
.
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.105.0 (build 0a2adcb)", date = "2024-11-15T12:15:24.901Z")
@software.amazon.jsii.Jsii(module = org.cdk8s.plus31.$Module.class, fqn = "cdk8s-plus-31.StatefulSetProps")
@software.amazon.jsii.Jsii.Proxy(StatefulSetProps.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public interface StatefulSetProps extends software.amazon.jsii.JsiiSerializable, org.cdk8s.plus31.WorkloadProps {
/**
* Minimum duration for which a newly created pod should be ready without any of its container crashing, for it to be considered available.
*
* Zero means the pod will be considered available as soon as it is ready.
*
* This is an alpha field and requires enabling StatefulSetMinReadySeconds feature gate.
*
* Default: Duration.seconds(0)
*
* @see https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#min-ready-seconds
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable org.cdk8s.Duration getMinReady() {
return null;
}
/**
* Pod management policy to use for this statefulset.
*
* Default: PodManagementPolicy.ORDERED_READY
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable org.cdk8s.plus31.PodManagementPolicy getPodManagementPolicy() {
return null;
}
/**
* Number of desired pods.
*
* Default: 1
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.Number getReplicas() {
return null;
}
/**
* Service to associate with the statefulset.
*
* Default: - A new headless service will be created.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable org.cdk8s.plus31.Service getService() {
return null;
}
/**
* Indicates the StatefulSetUpdateStrategy that will be employed to update Pods in the StatefulSet when a revision is made to Template.
*
* Default: - RollingUpdate with partition set to 0
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable org.cdk8s.plus31.StatefulSetUpdateStrategy getStrategy() {
return null;
}
/**
* @return a {@link Builder} of {@link StatefulSetProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link StatefulSetProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public static final class Builder implements software.amazon.jsii.Builder {
org.cdk8s.Duration minReady;
org.cdk8s.plus31.PodManagementPolicy podManagementPolicy;
java.lang.Number replicas;
org.cdk8s.plus31.Service service;
org.cdk8s.plus31.StatefulSetUpdateStrategy strategy;
org.cdk8s.ApiObjectMetadata podMetadata;
java.lang.Boolean select;
java.lang.Boolean spread;
java.lang.Boolean automountServiceAccountToken;
java.util.List containers;
org.cdk8s.plus31.PodDnsProps dns;
org.cdk8s.plus31.ISecret dockerRegistryAuth;
java.util.List hostAliases;
java.lang.Boolean hostNetwork;
java.util.List initContainers;
java.lang.Boolean isolate;
org.cdk8s.plus31.RestartPolicy restartPolicy;
org.cdk8s.plus31.PodSecurityContextProps securityContext;
org.cdk8s.plus31.IServiceAccount serviceAccount;
org.cdk8s.Duration terminationGracePeriod;
java.util.List volumes;
org.cdk8s.ApiObjectMetadata metadata;
/**
* Sets the value of {@link StatefulSetProps#getMinReady}
* @param minReady Minimum duration for which a newly created pod should be ready without any of its container crashing, for it to be considered available.
* Zero means the pod will be considered available as soon as it is ready.
*
* This is an alpha field and requires enabling StatefulSetMinReadySeconds feature gate.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder minReady(org.cdk8s.Duration minReady) {
this.minReady = minReady;
return this;
}
/**
* Sets the value of {@link StatefulSetProps#getPodManagementPolicy}
* @param podManagementPolicy Pod management policy to use for this statefulset.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder podManagementPolicy(org.cdk8s.plus31.PodManagementPolicy podManagementPolicy) {
this.podManagementPolicy = podManagementPolicy;
return this;
}
/**
* Sets the value of {@link StatefulSetProps#getReplicas}
* @param replicas Number of desired pods.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder replicas(java.lang.Number replicas) {
this.replicas = replicas;
return this;
}
/**
* Sets the value of {@link StatefulSetProps#getService}
* @param service Service to associate with the statefulset.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder service(org.cdk8s.plus31.Service service) {
this.service = service;
return this;
}
/**
* Sets the value of {@link StatefulSetProps#getStrategy}
* @param strategy Indicates the StatefulSetUpdateStrategy that will be employed to update Pods in the StatefulSet when a revision is made to Template.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder strategy(org.cdk8s.plus31.StatefulSetUpdateStrategy strategy) {
this.strategy = strategy;
return this;
}
/**
* Sets the value of {@link StatefulSetProps#getPodMetadata}
* @param podMetadata The pod metadata of this workload.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder podMetadata(org.cdk8s.ApiObjectMetadata podMetadata) {
this.podMetadata = podMetadata;
return this;
}
/**
* Sets the value of {@link StatefulSetProps#getSelect}
* @param select Automatically allocates a pod label selector for this workload and add it to the pod metadata.
* This ensures this workload manages pods created by
* its pod template.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder select(java.lang.Boolean select) {
this.select = select;
return this;
}
/**
* Sets the value of {@link StatefulSetProps#getSpread}
* @param spread Automatically spread pods across hostname and zones.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder spread(java.lang.Boolean spread) {
this.spread = spread;
return this;
}
/**
* Sets the value of {@link StatefulSetProps#getAutomountServiceAccountToken}
* @param automountServiceAccountToken Indicates whether a service account token should be automatically mounted.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder automountServiceAccountToken(java.lang.Boolean automountServiceAccountToken) {
this.automountServiceAccountToken = automountServiceAccountToken;
return this;
}
/**
* Sets the value of {@link StatefulSetProps#getContainers}
* @param containers List of containers belonging to the pod.
* Containers cannot currently be
* added or removed. There must be at least one container in a Pod.
*
* You can add additionnal containers using podSpec.addContainer()
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@SuppressWarnings("unchecked")
public Builder containers(java.util.List extends org.cdk8s.plus31.ContainerProps> containers) {
this.containers = (java.util.List)containers;
return this;
}
/**
* Sets the value of {@link StatefulSetProps#getDns}
* @param dns DNS settings for the pod.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder dns(org.cdk8s.plus31.PodDnsProps dns) {
this.dns = dns;
return this;
}
/**
* Sets the value of {@link StatefulSetProps#getDockerRegistryAuth}
* @param dockerRegistryAuth A secret containing docker credentials for authenticating to a registry.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder dockerRegistryAuth(org.cdk8s.plus31.ISecret dockerRegistryAuth) {
this.dockerRegistryAuth = dockerRegistryAuth;
return this;
}
/**
* Sets the value of {@link StatefulSetProps#getHostAliases}
* @param hostAliases HostAlias holds the mapping between IP and hostnames that will be injected as an entry in the pod's hosts file.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@SuppressWarnings("unchecked")
public Builder hostAliases(java.util.List extends org.cdk8s.plus31.HostAlias> hostAliases) {
this.hostAliases = (java.util.List)hostAliases;
return this;
}
/**
* Sets the value of {@link StatefulSetProps#getHostNetwork}
* @param hostNetwork Host network for the pod.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder hostNetwork(java.lang.Boolean hostNetwork) {
this.hostNetwork = hostNetwork;
return this;
}
/**
* Sets the value of {@link StatefulSetProps#getInitContainers}
* @param initContainers List of initialization containers belonging to the pod.
* Init containers are executed in order prior to containers being started.
* If any init container fails, the pod is considered to have failed and is handled according to its restartPolicy.
* The name for an init container or normal container must be unique among all containers.
* Init containers may not have Lifecycle actions, Readiness probes, Liveness probes, or Startup probes.
* The resourceRequirements of an init container are taken into account during scheduling by finding the highest request/limit
* for each resource type, and then using the max of of that value or the sum of the normal containers.
* Limits are applied to init containers in a similar fashion.
*
* Init containers cannot currently be added ,removed or updated.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@SuppressWarnings("unchecked")
public Builder initContainers(java.util.List extends org.cdk8s.plus31.ContainerProps> initContainers) {
this.initContainers = (java.util.List)initContainers;
return this;
}
/**
* Sets the value of {@link StatefulSetProps#getIsolate}
* @param isolate Isolates the pod.
* This will prevent any ingress or egress connections to / from this pod.
* You can however allow explicit connections post instantiation by using the .connections
property.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder isolate(java.lang.Boolean isolate) {
this.isolate = isolate;
return this;
}
/**
* Sets the value of {@link StatefulSetProps#getRestartPolicy}
* @param restartPolicy Restart policy for all containers within the pod.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder restartPolicy(org.cdk8s.plus31.RestartPolicy restartPolicy) {
this.restartPolicy = restartPolicy;
return this;
}
/**
* Sets the value of {@link StatefulSetProps#getSecurityContext}
* @param securityContext SecurityContext holds pod-level security attributes and common container settings.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder securityContext(org.cdk8s.plus31.PodSecurityContextProps securityContext) {
this.securityContext = securityContext;
return this;
}
/**
* Sets the value of {@link StatefulSetProps#getServiceAccount}
* @param serviceAccount A service account provides an identity for processes that run in a Pod.
* When you (a human) access the cluster (for example, using kubectl), you are
* authenticated by the apiserver as a particular User Account (currently this
* is usually admin, unless your cluster administrator has customized your
* cluster). Processes in containers inside pods can also contact the
* apiserver. When they do, they are authenticated as a particular Service
* Account (for example, default).
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder serviceAccount(org.cdk8s.plus31.IServiceAccount serviceAccount) {
this.serviceAccount = serviceAccount;
return this;
}
/**
* Sets the value of {@link StatefulSetProps#getTerminationGracePeriod}
* @param terminationGracePeriod Grace period until the pod is terminated.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder terminationGracePeriod(org.cdk8s.Duration terminationGracePeriod) {
this.terminationGracePeriod = terminationGracePeriod;
return this;
}
/**
* Sets the value of {@link StatefulSetProps#getVolumes}
* @param volumes List of volumes that can be mounted by containers belonging to the pod.
* You can also add volumes later using podSpec.addVolume()
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@SuppressWarnings("unchecked")
public Builder volumes(java.util.List extends org.cdk8s.plus31.Volume> volumes) {
this.volumes = (java.util.List)volumes;
return this;
}
/**
* Sets the value of {@link StatefulSetProps#getMetadata}
* @param metadata Metadata that all persisted resources must have, which includes all objects users must create.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder metadata(org.cdk8s.ApiObjectMetadata metadata) {
this.metadata = metadata;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link StatefulSetProps}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public StatefulSetProps build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link StatefulSetProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements StatefulSetProps {
private final org.cdk8s.Duration minReady;
private final org.cdk8s.plus31.PodManagementPolicy podManagementPolicy;
private final java.lang.Number replicas;
private final org.cdk8s.plus31.Service service;
private final org.cdk8s.plus31.StatefulSetUpdateStrategy strategy;
private final org.cdk8s.ApiObjectMetadata podMetadata;
private final java.lang.Boolean select;
private final java.lang.Boolean spread;
private final java.lang.Boolean automountServiceAccountToken;
private final java.util.List containers;
private final org.cdk8s.plus31.PodDnsProps dns;
private final org.cdk8s.plus31.ISecret dockerRegistryAuth;
private final java.util.List hostAliases;
private final java.lang.Boolean hostNetwork;
private final java.util.List initContainers;
private final java.lang.Boolean isolate;
private final org.cdk8s.plus31.RestartPolicy restartPolicy;
private final org.cdk8s.plus31.PodSecurityContextProps securityContext;
private final org.cdk8s.plus31.IServiceAccount serviceAccount;
private final org.cdk8s.Duration terminationGracePeriod;
private final java.util.List volumes;
private final org.cdk8s.ApiObjectMetadata metadata;
/**
* 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.minReady = software.amazon.jsii.Kernel.get(this, "minReady", software.amazon.jsii.NativeType.forClass(org.cdk8s.Duration.class));
this.podManagementPolicy = software.amazon.jsii.Kernel.get(this, "podManagementPolicy", software.amazon.jsii.NativeType.forClass(org.cdk8s.plus31.PodManagementPolicy.class));
this.replicas = software.amazon.jsii.Kernel.get(this, "replicas", software.amazon.jsii.NativeType.forClass(java.lang.Number.class));
this.service = software.amazon.jsii.Kernel.get(this, "service", software.amazon.jsii.NativeType.forClass(org.cdk8s.plus31.Service.class));
this.strategy = software.amazon.jsii.Kernel.get(this, "strategy", software.amazon.jsii.NativeType.forClass(org.cdk8s.plus31.StatefulSetUpdateStrategy.class));
this.podMetadata = software.amazon.jsii.Kernel.get(this, "podMetadata", software.amazon.jsii.NativeType.forClass(org.cdk8s.ApiObjectMetadata.class));
this.select = software.amazon.jsii.Kernel.get(this, "select", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.class));
this.spread = software.amazon.jsii.Kernel.get(this, "spread", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.class));
this.automountServiceAccountToken = software.amazon.jsii.Kernel.get(this, "automountServiceAccountToken", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.class));
this.containers = software.amazon.jsii.Kernel.get(this, "containers", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(org.cdk8s.plus31.ContainerProps.class)));
this.dns = software.amazon.jsii.Kernel.get(this, "dns", software.amazon.jsii.NativeType.forClass(org.cdk8s.plus31.PodDnsProps.class));
this.dockerRegistryAuth = software.amazon.jsii.Kernel.get(this, "dockerRegistryAuth", software.amazon.jsii.NativeType.forClass(org.cdk8s.plus31.ISecret.class));
this.hostAliases = software.amazon.jsii.Kernel.get(this, "hostAliases", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(org.cdk8s.plus31.HostAlias.class)));
this.hostNetwork = software.amazon.jsii.Kernel.get(this, "hostNetwork", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.class));
this.initContainers = software.amazon.jsii.Kernel.get(this, "initContainers", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(org.cdk8s.plus31.ContainerProps.class)));
this.isolate = software.amazon.jsii.Kernel.get(this, "isolate", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.class));
this.restartPolicy = software.amazon.jsii.Kernel.get(this, "restartPolicy", software.amazon.jsii.NativeType.forClass(org.cdk8s.plus31.RestartPolicy.class));
this.securityContext = software.amazon.jsii.Kernel.get(this, "securityContext", software.amazon.jsii.NativeType.forClass(org.cdk8s.plus31.PodSecurityContextProps.class));
this.serviceAccount = software.amazon.jsii.Kernel.get(this, "serviceAccount", software.amazon.jsii.NativeType.forClass(org.cdk8s.plus31.IServiceAccount.class));
this.terminationGracePeriod = software.amazon.jsii.Kernel.get(this, "terminationGracePeriod", software.amazon.jsii.NativeType.forClass(org.cdk8s.Duration.class));
this.volumes = software.amazon.jsii.Kernel.get(this, "volumes", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(org.cdk8s.plus31.Volume.class)));
this.metadata = software.amazon.jsii.Kernel.get(this, "metadata", software.amazon.jsii.NativeType.forClass(org.cdk8s.ApiObjectMetadata.class));
}
/**
* Constructor that initializes the object based on literal property values passed by the {@link Builder}.
*/
@SuppressWarnings("unchecked")
protected Jsii$Proxy(final Builder builder) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
this.minReady = builder.minReady;
this.podManagementPolicy = builder.podManagementPolicy;
this.replicas = builder.replicas;
this.service = builder.service;
this.strategy = builder.strategy;
this.podMetadata = builder.podMetadata;
this.select = builder.select;
this.spread = builder.spread;
this.automountServiceAccountToken = builder.automountServiceAccountToken;
this.containers = (java.util.List)builder.containers;
this.dns = builder.dns;
this.dockerRegistryAuth = builder.dockerRegistryAuth;
this.hostAliases = (java.util.List)builder.hostAliases;
this.hostNetwork = builder.hostNetwork;
this.initContainers = (java.util.List)builder.initContainers;
this.isolate = builder.isolate;
this.restartPolicy = builder.restartPolicy;
this.securityContext = builder.securityContext;
this.serviceAccount = builder.serviceAccount;
this.terminationGracePeriod = builder.terminationGracePeriod;
this.volumes = (java.util.List)builder.volumes;
this.metadata = builder.metadata;
}
@Override
public final org.cdk8s.Duration getMinReady() {
return this.minReady;
}
@Override
public final org.cdk8s.plus31.PodManagementPolicy getPodManagementPolicy() {
return this.podManagementPolicy;
}
@Override
public final java.lang.Number getReplicas() {
return this.replicas;
}
@Override
public final org.cdk8s.plus31.Service getService() {
return this.service;
}
@Override
public final org.cdk8s.plus31.StatefulSetUpdateStrategy getStrategy() {
return this.strategy;
}
@Override
public final org.cdk8s.ApiObjectMetadata getPodMetadata() {
return this.podMetadata;
}
@Override
public final java.lang.Boolean getSelect() {
return this.select;
}
@Override
public final java.lang.Boolean getSpread() {
return this.spread;
}
@Override
public final java.lang.Boolean getAutomountServiceAccountToken() {
return this.automountServiceAccountToken;
}
@Override
public final java.util.List getContainers() {
return this.containers;
}
@Override
public final org.cdk8s.plus31.PodDnsProps getDns() {
return this.dns;
}
@Override
public final org.cdk8s.plus31.ISecret getDockerRegistryAuth() {
return this.dockerRegistryAuth;
}
@Override
public final java.util.List getHostAliases() {
return this.hostAliases;
}
@Override
public final java.lang.Boolean getHostNetwork() {
return this.hostNetwork;
}
@Override
public final java.util.List getInitContainers() {
return this.initContainers;
}
@Override
public final java.lang.Boolean getIsolate() {
return this.isolate;
}
@Override
public final org.cdk8s.plus31.RestartPolicy getRestartPolicy() {
return this.restartPolicy;
}
@Override
public final org.cdk8s.plus31.PodSecurityContextProps getSecurityContext() {
return this.securityContext;
}
@Override
public final org.cdk8s.plus31.IServiceAccount getServiceAccount() {
return this.serviceAccount;
}
@Override
public final org.cdk8s.Duration getTerminationGracePeriod() {
return this.terminationGracePeriod;
}
@Override
public final java.util.List getVolumes() {
return this.volumes;
}
@Override
public final org.cdk8s.ApiObjectMetadata getMetadata() {
return this.metadata;
}
@Override
@software.amazon.jsii.Internal
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.getMinReady() != null) {
data.set("minReady", om.valueToTree(this.getMinReady()));
}
if (this.getPodManagementPolicy() != null) {
data.set("podManagementPolicy", om.valueToTree(this.getPodManagementPolicy()));
}
if (this.getReplicas() != null) {
data.set("replicas", om.valueToTree(this.getReplicas()));
}
if (this.getService() != null) {
data.set("service", om.valueToTree(this.getService()));
}
if (this.getStrategy() != null) {
data.set("strategy", om.valueToTree(this.getStrategy()));
}
if (this.getPodMetadata() != null) {
data.set("podMetadata", om.valueToTree(this.getPodMetadata()));
}
if (this.getSelect() != null) {
data.set("select", om.valueToTree(this.getSelect()));
}
if (this.getSpread() != null) {
data.set("spread", om.valueToTree(this.getSpread()));
}
if (this.getAutomountServiceAccountToken() != null) {
data.set("automountServiceAccountToken", om.valueToTree(this.getAutomountServiceAccountToken()));
}
if (this.getContainers() != null) {
data.set("containers", om.valueToTree(this.getContainers()));
}
if (this.getDns() != null) {
data.set("dns", om.valueToTree(this.getDns()));
}
if (this.getDockerRegistryAuth() != null) {
data.set("dockerRegistryAuth", om.valueToTree(this.getDockerRegistryAuth()));
}
if (this.getHostAliases() != null) {
data.set("hostAliases", om.valueToTree(this.getHostAliases()));
}
if (this.getHostNetwork() != null) {
data.set("hostNetwork", om.valueToTree(this.getHostNetwork()));
}
if (this.getInitContainers() != null) {
data.set("initContainers", om.valueToTree(this.getInitContainers()));
}
if (this.getIsolate() != null) {
data.set("isolate", om.valueToTree(this.getIsolate()));
}
if (this.getRestartPolicy() != null) {
data.set("restartPolicy", om.valueToTree(this.getRestartPolicy()));
}
if (this.getSecurityContext() != null) {
data.set("securityContext", om.valueToTree(this.getSecurityContext()));
}
if (this.getServiceAccount() != null) {
data.set("serviceAccount", om.valueToTree(this.getServiceAccount()));
}
if (this.getTerminationGracePeriod() != null) {
data.set("terminationGracePeriod", om.valueToTree(this.getTerminationGracePeriod()));
}
if (this.getVolumes() != null) {
data.set("volumes", om.valueToTree(this.getVolumes()));
}
if (this.getMetadata() != null) {
data.set("metadata", om.valueToTree(this.getMetadata()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("cdk8s-plus-31.StatefulSetProps"));
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 final boolean equals(final Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
StatefulSetProps.Jsii$Proxy that = (StatefulSetProps.Jsii$Proxy) o;
if (this.minReady != null ? !this.minReady.equals(that.minReady) : that.minReady != null) return false;
if (this.podManagementPolicy != null ? !this.podManagementPolicy.equals(that.podManagementPolicy) : that.podManagementPolicy != null) return false;
if (this.replicas != null ? !this.replicas.equals(that.replicas) : that.replicas != null) return false;
if (this.service != null ? !this.service.equals(that.service) : that.service != null) return false;
if (this.strategy != null ? !this.strategy.equals(that.strategy) : that.strategy != null) return false;
if (this.podMetadata != null ? !this.podMetadata.equals(that.podMetadata) : that.podMetadata != null) return false;
if (this.select != null ? !this.select.equals(that.select) : that.select != null) return false;
if (this.spread != null ? !this.spread.equals(that.spread) : that.spread != null) return false;
if (this.automountServiceAccountToken != null ? !this.automountServiceAccountToken.equals(that.automountServiceAccountToken) : that.automountServiceAccountToken != null) return false;
if (this.containers != null ? !this.containers.equals(that.containers) : that.containers != null) return false;
if (this.dns != null ? !this.dns.equals(that.dns) : that.dns != null) return false;
if (this.dockerRegistryAuth != null ? !this.dockerRegistryAuth.equals(that.dockerRegistryAuth) : that.dockerRegistryAuth != null) return false;
if (this.hostAliases != null ? !this.hostAliases.equals(that.hostAliases) : that.hostAliases != null) return false;
if (this.hostNetwork != null ? !this.hostNetwork.equals(that.hostNetwork) : that.hostNetwork != null) return false;
if (this.initContainers != null ? !this.initContainers.equals(that.initContainers) : that.initContainers != null) return false;
if (this.isolate != null ? !this.isolate.equals(that.isolate) : that.isolate != null) return false;
if (this.restartPolicy != null ? !this.restartPolicy.equals(that.restartPolicy) : that.restartPolicy != null) return false;
if (this.securityContext != null ? !this.securityContext.equals(that.securityContext) : that.securityContext != null) return false;
if (this.serviceAccount != null ? !this.serviceAccount.equals(that.serviceAccount) : that.serviceAccount != null) return false;
if (this.terminationGracePeriod != null ? !this.terminationGracePeriod.equals(that.terminationGracePeriod) : that.terminationGracePeriod != null) return false;
if (this.volumes != null ? !this.volumes.equals(that.volumes) : that.volumes != null) return false;
return this.metadata != null ? this.metadata.equals(that.metadata) : that.metadata == null;
}
@Override
public final int hashCode() {
int result = this.minReady != null ? this.minReady.hashCode() : 0;
result = 31 * result + (this.podManagementPolicy != null ? this.podManagementPolicy.hashCode() : 0);
result = 31 * result + (this.replicas != null ? this.replicas.hashCode() : 0);
result = 31 * result + (this.service != null ? this.service.hashCode() : 0);
result = 31 * result + (this.strategy != null ? this.strategy.hashCode() : 0);
result = 31 * result + (this.podMetadata != null ? this.podMetadata.hashCode() : 0);
result = 31 * result + (this.select != null ? this.select.hashCode() : 0);
result = 31 * result + (this.spread != null ? this.spread.hashCode() : 0);
result = 31 * result + (this.automountServiceAccountToken != null ? this.automountServiceAccountToken.hashCode() : 0);
result = 31 * result + (this.containers != null ? this.containers.hashCode() : 0);
result = 31 * result + (this.dns != null ? this.dns.hashCode() : 0);
result = 31 * result + (this.dockerRegistryAuth != null ? this.dockerRegistryAuth.hashCode() : 0);
result = 31 * result + (this.hostAliases != null ? this.hostAliases.hashCode() : 0);
result = 31 * result + (this.hostNetwork != null ? this.hostNetwork.hashCode() : 0);
result = 31 * result + (this.initContainers != null ? this.initContainers.hashCode() : 0);
result = 31 * result + (this.isolate != null ? this.isolate.hashCode() : 0);
result = 31 * result + (this.restartPolicy != null ? this.restartPolicy.hashCode() : 0);
result = 31 * result + (this.securityContext != null ? this.securityContext.hashCode() : 0);
result = 31 * result + (this.serviceAccount != null ? this.serviceAccount.hashCode() : 0);
result = 31 * result + (this.terminationGracePeriod != null ? this.terminationGracePeriod.hashCode() : 0);
result = 31 * result + (this.volumes != null ? this.volumes.hashCode() : 0);
result = 31 * result + (this.metadata != null ? this.metadata.hashCode() : 0);
return result;
}
}
}