io.github.cdklabs.projen.DockerComposeNetworkConfig Maven / Gradle / Ivy
Show all versions of projen Show documentation
package io.github.cdklabs.projen;
/**
* (experimental) Network configuration.
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.105.0 (build 0a2adcb)", date = "2024-11-15T17:03:54.767Z")
@software.amazon.jsii.Jsii(module = io.github.cdklabs.projen.$Module.class, fqn = "projen.DockerComposeNetworkConfig")
@software.amazon.jsii.Jsii.Proxy(DockerComposeNetworkConfig.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public interface DockerComposeNetworkConfig extends software.amazon.jsii.JsiiSerializable {
/**
* (experimental) Set to true to indicate that standalone containers can attach to this network, in addition to services.
*
* Default: - unset
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.Boolean getAttachable() {
return null;
}
/**
* (experimental) Set to true to indicate that the network is a bridge network.
*
* Default: - unset
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.Boolean getBridge() {
return null;
}
/**
* (experimental) Driver to use for the network.
*
* Default: - value is not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.String getDriver() {
return null;
}
/**
* (experimental) Options for the configured driver.
*
* Those options are driver-dependent - consult the driver’s documentation for more information
*
* Default: - value is not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable com.fasterxml.jackson.databind.node.ObjectNode getDriverOpts() {
return null;
}
/**
* (experimental) Set to true to indicate that the network is externally created.
*
* Default: - unset, indicating that docker-compose creates the network
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.Boolean getExternal() {
return null;
}
/**
* (experimental) Set to true to indicate that you want to create an externally isolated overlay network.
*
* Default: - unset
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.Boolean getInternal() {
return null;
}
/**
* (experimental) Specify custom IPAM config.
*
* Default: - unset
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable io.github.cdklabs.projen.DockerComposeNetworkIpamConfig getIpam() {
return null;
}
/**
* (experimental) Attach labels to the network.
*
* Default: - unset
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.util.List getLabels() {
return null;
}
/**
* (experimental) Name of the network for when the network name isn't going to work in YAML.
*
* Default: - unset, indicating that docker-compose creates networks as usual
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.String getName() {
return null;
}
/**
* (experimental) Set to true to indicate that the network is an overlay network.
*
* Default: - unset
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.Boolean getOverlay() {
return null;
}
/**
* @return a {@link Builder} of {@link DockerComposeNetworkConfig}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link DockerComposeNetworkConfig}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
java.lang.Boolean attachable;
java.lang.Boolean bridge;
java.lang.String driver;
com.fasterxml.jackson.databind.node.ObjectNode driverOpts;
java.lang.Boolean external;
java.lang.Boolean internal;
io.github.cdklabs.projen.DockerComposeNetworkIpamConfig ipam;
java.util.List labels;
java.lang.String name;
java.lang.Boolean overlay;
/**
* Sets the value of {@link DockerComposeNetworkConfig#getAttachable}
* @param attachable Set to true to indicate that standalone containers can attach to this network, in addition to services.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder attachable(java.lang.Boolean attachable) {
this.attachable = attachable;
return this;
}
/**
* Sets the value of {@link DockerComposeNetworkConfig#getBridge}
* @param bridge Set to true to indicate that the network is a bridge network.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder bridge(java.lang.Boolean bridge) {
this.bridge = bridge;
return this;
}
/**
* Sets the value of {@link DockerComposeNetworkConfig#getDriver}
* @param driver Driver to use for the network.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder driver(java.lang.String driver) {
this.driver = driver;
return this;
}
/**
* Sets the value of {@link DockerComposeNetworkConfig#getDriverOpts}
* @param driverOpts Options for the configured driver.
* Those options are driver-dependent - consult the driver’s documentation for more information
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder driverOpts(com.fasterxml.jackson.databind.node.ObjectNode driverOpts) {
this.driverOpts = driverOpts;
return this;
}
/**
* Sets the value of {@link DockerComposeNetworkConfig#getExternal}
* @param external Set to true to indicate that the network is externally created.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder external(java.lang.Boolean external) {
this.external = external;
return this;
}
/**
* Sets the value of {@link DockerComposeNetworkConfig#getInternal}
* @param internal Set to true to indicate that you want to create an externally isolated overlay network.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder internal(java.lang.Boolean internal) {
this.internal = internal;
return this;
}
/**
* Sets the value of {@link DockerComposeNetworkConfig#getIpam}
* @param ipam Specify custom IPAM config.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder ipam(io.github.cdklabs.projen.DockerComposeNetworkIpamConfig ipam) {
this.ipam = ipam;
return this;
}
/**
* Sets the value of {@link DockerComposeNetworkConfig#getLabels}
* @param labels Attach labels to the network.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder labels(java.util.List labels) {
this.labels = labels;
return this;
}
/**
* Sets the value of {@link DockerComposeNetworkConfig#getName}
* @param name Name of the network for when the network name isn't going to work in YAML.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder name(java.lang.String name) {
this.name = name;
return this;
}
/**
* Sets the value of {@link DockerComposeNetworkConfig#getOverlay}
* @param overlay Set to true to indicate that the network is an overlay network.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder overlay(java.lang.Boolean overlay) {
this.overlay = overlay;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link DockerComposeNetworkConfig}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public DockerComposeNetworkConfig build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link DockerComposeNetworkConfig}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements DockerComposeNetworkConfig {
private final java.lang.Boolean attachable;
private final java.lang.Boolean bridge;
private final java.lang.String driver;
private final com.fasterxml.jackson.databind.node.ObjectNode driverOpts;
private final java.lang.Boolean external;
private final java.lang.Boolean internal;
private final io.github.cdklabs.projen.DockerComposeNetworkIpamConfig ipam;
private final java.util.List labels;
private final java.lang.String name;
private final java.lang.Boolean overlay;
/**
* 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.attachable = software.amazon.jsii.Kernel.get(this, "attachable", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.class));
this.bridge = software.amazon.jsii.Kernel.get(this, "bridge", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.class));
this.driver = software.amazon.jsii.Kernel.get(this, "driver", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.driverOpts = software.amazon.jsii.Kernel.get(this, "driverOpts", software.amazon.jsii.NativeType.forClass(com.fasterxml.jackson.databind.node.ObjectNode.class));
this.external = software.amazon.jsii.Kernel.get(this, "external", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.class));
this.internal = software.amazon.jsii.Kernel.get(this, "internal", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.class));
this.ipam = software.amazon.jsii.Kernel.get(this, "ipam", software.amazon.jsii.NativeType.forClass(io.github.cdklabs.projen.DockerComposeNetworkIpamConfig.class));
this.labels = software.amazon.jsii.Kernel.get(this, "labels", software.amazon.jsii.NativeType.listOf(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.overlay = software.amazon.jsii.Kernel.get(this, "overlay", 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.attachable = builder.attachable;
this.bridge = builder.bridge;
this.driver = builder.driver;
this.driverOpts = builder.driverOpts;
this.external = builder.external;
this.internal = builder.internal;
this.ipam = builder.ipam;
this.labels = builder.labels;
this.name = builder.name;
this.overlay = builder.overlay;
}
@Override
public final java.lang.Boolean getAttachable() {
return this.attachable;
}
@Override
public final java.lang.Boolean getBridge() {
return this.bridge;
}
@Override
public final java.lang.String getDriver() {
return this.driver;
}
@Override
public final com.fasterxml.jackson.databind.node.ObjectNode getDriverOpts() {
return this.driverOpts;
}
@Override
public final java.lang.Boolean getExternal() {
return this.external;
}
@Override
public final java.lang.Boolean getInternal() {
return this.internal;
}
@Override
public final io.github.cdklabs.projen.DockerComposeNetworkIpamConfig getIpam() {
return this.ipam;
}
@Override
public final java.util.List getLabels() {
return this.labels;
}
@Override
public final java.lang.String getName() {
return this.name;
}
@Override
public final java.lang.Boolean getOverlay() {
return this.overlay;
}
@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.getAttachable() != null) {
data.set("attachable", om.valueToTree(this.getAttachable()));
}
if (this.getBridge() != null) {
data.set("bridge", om.valueToTree(this.getBridge()));
}
if (this.getDriver() != null) {
data.set("driver", om.valueToTree(this.getDriver()));
}
if (this.getDriverOpts() != null) {
data.set("driverOpts", om.valueToTree(this.getDriverOpts()));
}
if (this.getExternal() != null) {
data.set("external", om.valueToTree(this.getExternal()));
}
if (this.getInternal() != null) {
data.set("internal", om.valueToTree(this.getInternal()));
}
if (this.getIpam() != null) {
data.set("ipam", om.valueToTree(this.getIpam()));
}
if (this.getLabels() != null) {
data.set("labels", om.valueToTree(this.getLabels()));
}
if (this.getName() != null) {
data.set("name", om.valueToTree(this.getName()));
}
if (this.getOverlay() != null) {
data.set("overlay", om.valueToTree(this.getOverlay()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("projen.DockerComposeNetworkConfig"));
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;
DockerComposeNetworkConfig.Jsii$Proxy that = (DockerComposeNetworkConfig.Jsii$Proxy) o;
if (this.attachable != null ? !this.attachable.equals(that.attachable) : that.attachable != null) return false;
if (this.bridge != null ? !this.bridge.equals(that.bridge) : that.bridge != null) return false;
if (this.driver != null ? !this.driver.equals(that.driver) : that.driver != null) return false;
if (this.driverOpts != null ? !this.driverOpts.equals(that.driverOpts) : that.driverOpts != null) return false;
if (this.external != null ? !this.external.equals(that.external) : that.external != null) return false;
if (this.internal != null ? !this.internal.equals(that.internal) : that.internal != null) return false;
if (this.ipam != null ? !this.ipam.equals(that.ipam) : that.ipam != null) return false;
if (this.labels != null ? !this.labels.equals(that.labels) : that.labels != null) return false;
if (this.name != null ? !this.name.equals(that.name) : that.name != null) return false;
return this.overlay != null ? this.overlay.equals(that.overlay) : that.overlay == null;
}
@Override
public final int hashCode() {
int result = this.attachable != null ? this.attachable.hashCode() : 0;
result = 31 * result + (this.bridge != null ? this.bridge.hashCode() : 0);
result = 31 * result + (this.driver != null ? this.driver.hashCode() : 0);
result = 31 * result + (this.driverOpts != null ? this.driverOpts.hashCode() : 0);
result = 31 * result + (this.external != null ? this.external.hashCode() : 0);
result = 31 * result + (this.internal != null ? this.internal.hashCode() : 0);
result = 31 * result + (this.ipam != null ? this.ipam.hashCode() : 0);
result = 31 * result + (this.labels != null ? this.labels.hashCode() : 0);
result = 31 * result + (this.name != null ? this.name.hashCode() : 0);
result = 31 * result + (this.overlay != null ? this.overlay.hashCode() : 0);
return result;
}
}
}