
org.cdk8s.plus31.CsiVolumeOptions Maven / Gradle / Ivy
package org.cdk8s.plus31;
/**
* Options for the CSI driver based volume.
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.105.0 (build 0a2adcb)", date = "2024-11-15T12:15:24.808Z")
@software.amazon.jsii.Jsii(module = org.cdk8s.plus31.$Module.class, fqn = "cdk8s-plus-31.CsiVolumeOptions")
@software.amazon.jsii.Jsii.Proxy(CsiVolumeOptions.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public interface CsiVolumeOptions extends software.amazon.jsii.JsiiSerializable {
/**
* Any driver-specific attributes to pass to the CSI volume builder.
*
* Default: - undefined
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.util.Map getAttributes() {
return null;
}
/**
* The filesystem type to mount.
*
* Ex. "ext4", "xfs", "ntfs". If not provided,
* the empty value is passed to the associated CSI driver, which will
* determine the default filesystem to apply.
*
* Default: - driver-dependent
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.String getFsType() {
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;
}
/**
* Whether the mounted volume should be read-only or not.
*
* Default: - false
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.Boolean getReadOnly() {
return null;
}
/**
* @return a {@link Builder} of {@link CsiVolumeOptions}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link CsiVolumeOptions}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public static final class Builder implements software.amazon.jsii.Builder {
java.util.Map attributes;
java.lang.String fsType;
java.lang.String name;
java.lang.Boolean readOnly;
/**
* Sets the value of {@link CsiVolumeOptions#getAttributes}
* @param attributes Any driver-specific attributes to pass to the CSI volume builder.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder attributes(java.util.Map attributes) {
this.attributes = attributes;
return this;
}
/**
* Sets the value of {@link CsiVolumeOptions#getFsType}
* @param fsType The filesystem type to mount.
* Ex. "ext4", "xfs", "ntfs". If not provided,
* the empty value is passed to the associated CSI driver, which will
* determine the default filesystem to apply.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder fsType(java.lang.String fsType) {
this.fsType = fsType;
return this;
}
/**
* Sets the value of {@link CsiVolumeOptions#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 CsiVolumeOptions#getReadOnly}
* @param readOnly Whether the mounted volume should be read-only or not.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder readOnly(java.lang.Boolean readOnly) {
this.readOnly = readOnly;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link CsiVolumeOptions}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public CsiVolumeOptions build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link CsiVolumeOptions}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements CsiVolumeOptions {
private final java.util.Map attributes;
private final java.lang.String fsType;
private final java.lang.String name;
private final java.lang.Boolean readOnly;
/**
* 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.attributes = software.amazon.jsii.Kernel.get(this, "attributes", software.amazon.jsii.NativeType.mapOf(software.amazon.jsii.NativeType.forClass(java.lang.String.class)));
this.fsType = software.amazon.jsii.Kernel.get(this, "fsType", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.name = software.amazon.jsii.Kernel.get(this, "name", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.readOnly = software.amazon.jsii.Kernel.get(this, "readOnly", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.class));
}
/**
* Constructor that initializes the object based on literal property values passed by the {@link Builder}.
*/
protected Jsii$Proxy(final Builder builder) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
this.attributes = builder.attributes;
this.fsType = builder.fsType;
this.name = builder.name;
this.readOnly = builder.readOnly;
}
@Override
public final java.util.Map getAttributes() {
return this.attributes;
}
@Override
public final java.lang.String getFsType() {
return this.fsType;
}
@Override
public final java.lang.String getName() {
return this.name;
}
@Override
public final java.lang.Boolean getReadOnly() {
return this.readOnly;
}
@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.getAttributes() != null) {
data.set("attributes", om.valueToTree(this.getAttributes()));
}
if (this.getFsType() != null) {
data.set("fsType", om.valueToTree(this.getFsType()));
}
if (this.getName() != null) {
data.set("name", om.valueToTree(this.getName()));
}
if (this.getReadOnly() != null) {
data.set("readOnly", om.valueToTree(this.getReadOnly()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("cdk8s-plus-31.CsiVolumeOptions"));
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;
CsiVolumeOptions.Jsii$Proxy that = (CsiVolumeOptions.Jsii$Proxy) o;
if (this.attributes != null ? !this.attributes.equals(that.attributes) : that.attributes != null) return false;
if (this.fsType != null ? !this.fsType.equals(that.fsType) : that.fsType != null) return false;
if (this.name != null ? !this.name.equals(that.name) : that.name != null) return false;
return this.readOnly != null ? this.readOnly.equals(that.readOnly) : that.readOnly == null;
}
@Override
public final int hashCode() {
int result = this.attributes != null ? this.attributes.hashCode() : 0;
result = 31 * result + (this.fsType != null ? this.fsType.hashCode() : 0);
result = 31 * result + (this.name != null ? this.name.hashCode() : 0);
result = 31 * result + (this.readOnly != null ? this.readOnly.hashCode() : 0);
return result;
}
}
}