org.cdk8s.plus22.ConfigMapVolumeOptions Maven / Gradle / Ivy
Show all versions of cdk8s-plus-22 Show documentation
package org.cdk8s.plus22;
/**
* Options for the ConfigMap-based volume.
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.47.0 (build 86d2c33)", date = "2021-12-08T00:16:55.081Z")
@software.amazon.jsii.Jsii(module = org.cdk8s.plus22.$Module.class, fqn = "cdk8s-plus-22.ConfigMapVolumeOptions")
@software.amazon.jsii.Jsii.Proxy(ConfigMapVolumeOptions.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public interface ConfigMapVolumeOptions extends software.amazon.jsii.JsiiSerializable {
/**
* Mode bits to use on created files by default.
*
* Must be a value between 0 and
* 0777. Defaults to 0644. Directories within the path are not affected by
* this setting. This might be in conflict with other options that affect the
* file mode, like fsGroup, and the result can be other mode bits set.
*
* Default: 0644. Directories within the path are not affected by this
* setting. This might be in conflict with other options that affect the file
* mode, like fsGroup, and the result can be other mode bits set.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.Number getDefaultMode() {
return null;
}
/**
* If unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value.
*
* If specified, the listed keys will be projected
* into the specified paths, and unlisted keys will not be present. If a key
* is specified which is not present in the ConfigMap, the volume setup will
* error unless it is marked optional. Paths must be relative and may not
* contain the '..' path or start with '..'.
*
* Default: - no mapping
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.util.Map getItems() {
return null;
}
/**
* The volume name.
*
* Default: - auto-generated
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.String getName() {
return null;
}
/**
* Specify whether the ConfigMap or its keys must be defined.
*
* Default: - undocumented
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.Boolean getOptional() {
return null;
}
/**
* @return a {@link Builder} of {@link ConfigMapVolumeOptions}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link ConfigMapVolumeOptions}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public static final class Builder implements software.amazon.jsii.Builder {
java.lang.Number defaultMode;
java.util.Map items;
java.lang.String name;
java.lang.Boolean optional;
/**
* Sets the value of {@link ConfigMapVolumeOptions#getDefaultMode}
* @param defaultMode Mode bits to use on created files by default.
* Must be a value between 0 and
* 0777. Defaults to 0644. Directories within the path are not affected by
* this setting. This might be in conflict with other options that affect the
* file mode, like fsGroup, and the result can be other mode bits set.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder defaultMode(java.lang.Number defaultMode) {
this.defaultMode = defaultMode;
return this;
}
/**
* Sets the value of {@link ConfigMapVolumeOptions#getItems}
* @param items If unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value.
* If specified, the listed keys will be projected
* into the specified paths, and unlisted keys will not be present. If a key
* is specified which is not present in the ConfigMap, the volume setup will
* error unless it is marked optional. Paths must be relative and may not
* contain the '..' path or start with '..'.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@SuppressWarnings("unchecked")
public Builder items(java.util.Map items) {
this.items = (java.util.Map)items;
return this;
}
/**
* Sets the value of {@link ConfigMapVolumeOptions#getName}
* @param name The volume name.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder name(java.lang.String name) {
this.name = name;
return this;
}
/**
* Sets the value of {@link ConfigMapVolumeOptions#getOptional}
* @param optional Specify whether the ConfigMap or its keys must be defined.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder optional(java.lang.Boolean optional) {
this.optional = optional;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link ConfigMapVolumeOptions}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public ConfigMapVolumeOptions build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link ConfigMapVolumeOptions}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements ConfigMapVolumeOptions {
private final java.lang.Number defaultMode;
private final java.util.Map items;
private final java.lang.String name;
private final java.lang.Boolean optional;
/**
* 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.defaultMode = software.amazon.jsii.Kernel.get(this, "defaultMode", software.amazon.jsii.NativeType.forClass(java.lang.Number.class));
this.items = software.amazon.jsii.Kernel.get(this, "items", software.amazon.jsii.NativeType.mapOf(software.amazon.jsii.NativeType.forClass(org.cdk8s.plus22.PathMapping.class)));
this.name = software.amazon.jsii.Kernel.get(this, "name", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.optional = software.amazon.jsii.Kernel.get(this, "optional", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.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.defaultMode = builder.defaultMode;
this.items = (java.util.Map)builder.items;
this.name = builder.name;
this.optional = builder.optional;
}
@Override
public final java.lang.Number getDefaultMode() {
return this.defaultMode;
}
@Override
public final java.util.Map getItems() {
return this.items;
}
@Override
public final java.lang.String getName() {
return this.name;
}
@Override
public final java.lang.Boolean getOptional() {
return this.optional;
}
@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.getDefaultMode() != null) {
data.set("defaultMode", om.valueToTree(this.getDefaultMode()));
}
if (this.getItems() != null) {
data.set("items", om.valueToTree(this.getItems()));
}
if (this.getName() != null) {
data.set("name", om.valueToTree(this.getName()));
}
if (this.getOptional() != null) {
data.set("optional", om.valueToTree(this.getOptional()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("cdk8s-plus-22.ConfigMapVolumeOptions"));
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;
ConfigMapVolumeOptions.Jsii$Proxy that = (ConfigMapVolumeOptions.Jsii$Proxy) o;
if (this.defaultMode != null ? !this.defaultMode.equals(that.defaultMode) : that.defaultMode != null) return false;
if (this.items != null ? !this.items.equals(that.items) : that.items != null) return false;
if (this.name != null ? !this.name.equals(that.name) : that.name != null) return false;
return this.optional != null ? this.optional.equals(that.optional) : that.optional == null;
}
@Override
public final int hashCode() {
int result = this.defaultMode != null ? this.defaultMode.hashCode() : 0;
result = 31 * result + (this.items != null ? this.items.hashCode() : 0);
result = 31 * result + (this.name != null ? this.name.hashCode() : 0);
result = 31 * result + (this.optional != null ? this.optional.hashCode() : 0);
return result;
}
}
}