io.github.cdklabs.projen.DockerComposeProps Maven / Gradle / Ivy
Show all versions of projen Show documentation
package io.github.cdklabs.projen;
/**
* (experimental) Props for DockerCompose.
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.105.0 (build 0a2adcb)", date = "2024-11-15T17:03:54.774Z")
@software.amazon.jsii.Jsii(module = io.github.cdklabs.projen.$Module.class, fqn = "projen.DockerComposeProps")
@software.amazon.jsii.Jsii.Proxy(DockerComposeProps.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public interface DockerComposeProps extends software.amazon.jsii.JsiiSerializable {
/**
* (experimental) A name to add to the docker-compose.yml filename.
*
* Default: - no name is added
*
* Example:
*
*
* 'myname' yields 'docker-compose.myname.yml'
*
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.String getNameSuffix() {
return null;
}
/**
* (deprecated) Docker Compose schema version do be used.
*
* Default: - no version is provided
*
* @deprecated - The top level `version` field is obsolete per the Compose Specification.
* {@link https://github.com/compose-spec/compose-spec/blob/master/spec.md#version-and-name-top-level-elements Compose Specification}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Deprecated)
@Deprecated
default @org.jetbrains.annotations.Nullable java.lang.String getSchemaVersion() {
return null;
}
/**
* (experimental) Service descriptions.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.util.Map getServices() {
return null;
}
/**
* @return a {@link Builder} of {@link DockerComposeProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link DockerComposeProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
java.lang.String nameSuffix;
java.lang.String schemaVersion;
java.util.Map services;
/**
* Sets the value of {@link DockerComposeProps#getNameSuffix}
* @param nameSuffix A name to add to the docker-compose.yml filename.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder nameSuffix(java.lang.String nameSuffix) {
this.nameSuffix = nameSuffix;
return this;
}
/**
* Sets the value of {@link DockerComposeProps#getSchemaVersion}
* @param schemaVersion Docker Compose schema version do be used.
* @return {@code this}
* @deprecated - The top level `version` field is obsolete per the Compose Specification.
{@link https://github.com/compose-spec/compose-spec/blob/master/spec.md#version-and-name-top-level-elements Compose Specification}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Deprecated)
@Deprecated
public Builder schemaVersion(java.lang.String schemaVersion) {
this.schemaVersion = schemaVersion;
return this;
}
/**
* Sets the value of {@link DockerComposeProps#getServices}
* @param services Service descriptions.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@SuppressWarnings("unchecked")
public Builder services(java.util.Map services) {
this.services = (java.util.Map)services;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link DockerComposeProps}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public DockerComposeProps build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link DockerComposeProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements DockerComposeProps {
private final java.lang.String nameSuffix;
private final java.lang.String schemaVersion;
private final java.util.Map services;
/**
* 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.nameSuffix = software.amazon.jsii.Kernel.get(this, "nameSuffix", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.schemaVersion = software.amazon.jsii.Kernel.get(this, "schemaVersion", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.services = software.amazon.jsii.Kernel.get(this, "services", software.amazon.jsii.NativeType.mapOf(software.amazon.jsii.NativeType.forClass(io.github.cdklabs.projen.DockerComposeServiceDescription.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.nameSuffix = builder.nameSuffix;
this.schemaVersion = builder.schemaVersion;
this.services = (java.util.Map)builder.services;
}
@Override
public final java.lang.String getNameSuffix() {
return this.nameSuffix;
}
@Override
public final java.lang.String getSchemaVersion() {
return this.schemaVersion;
}
@Override
public final java.util.Map getServices() {
return this.services;
}
@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.getNameSuffix() != null) {
data.set("nameSuffix", om.valueToTree(this.getNameSuffix()));
}
if (this.getSchemaVersion() != null) {
data.set("schemaVersion", om.valueToTree(this.getSchemaVersion()));
}
if (this.getServices() != null) {
data.set("services", om.valueToTree(this.getServices()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("projen.DockerComposeProps"));
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;
DockerComposeProps.Jsii$Proxy that = (DockerComposeProps.Jsii$Proxy) o;
if (this.nameSuffix != null ? !this.nameSuffix.equals(that.nameSuffix) : that.nameSuffix != null) return false;
if (this.schemaVersion != null ? !this.schemaVersion.equals(that.schemaVersion) : that.schemaVersion != null) return false;
return this.services != null ? this.services.equals(that.services) : that.services == null;
}
@Override
public final int hashCode() {
int result = this.nameSuffix != null ? this.nameSuffix.hashCode() : 0;
result = 31 * result + (this.schemaVersion != null ? this.schemaVersion.hashCode() : 0);
result = 31 * result + (this.services != null ? this.services.hashCode() : 0);
return result;
}
}
}