org.cdk8s.image.ImageProps Maven / Gradle / Ivy
Show all versions of cdk8s-image Show documentation
package org.cdk8s.image;
/**
* Props for Image
.
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.103.1 (build bef2dea)", date = "2024-09-20T12:17:33.421Z")
@software.amazon.jsii.Jsii(module = org.cdk8s.image.$Module.class, fqn = "cdk8s-image.ImageProps")
@software.amazon.jsii.Jsii.Proxy(ImageProps.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public interface ImageProps extends software.amazon.jsii.JsiiSerializable {
/**
* The docker build context directory (where Dockerfile
is).
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@org.jetbrains.annotations.NotNull java.lang.String getDir();
/**
* List of build args to pass to the build action.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.util.List getBuildArgs() {
return null;
}
/**
* Path to Dockerfile.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.String getFile() {
return null;
}
/**
* Name for the image.
*
* Docker convention is {registry_name}/{name}:{tag}
* Visit https://docs.docker.com/engine/reference/commandline/tag/ for more information
*
* Default: - auto-generated name
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.String getName() {
return null;
}
/**
* Set to specify the target platform for the build output, (for example, linux/amd64, linux/arm64, or darwin/amd64).
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.String getPlatform() {
return null;
}
/**
* The registry URL to use.
*
* This will be used as the prefix for the image name.
*
* For example, if you have a local registry listening on port 500, you can set this to localhost:5000
.
*
* Default: "docker.io/library"
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.String getRegistry() {
return null;
}
/**
* Tag for the image.
*
* Docker convention is {registry_name}/{name}:{tag}
* Visit https://docs.docker.com/engine/reference/commandline/tag/ for more information
*
* Default: "latest"
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.String getTag() {
return null;
}
/**
* @return a {@link Builder} of {@link ImageProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link ImageProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public static final class Builder implements software.amazon.jsii.Builder {
java.lang.String dir;
java.util.List buildArgs;
java.lang.String file;
java.lang.String name;
java.lang.String platform;
java.lang.String registry;
java.lang.String tag;
/**
* Sets the value of {@link ImageProps#getDir}
* @param dir The docker build context directory (where Dockerfile
is). This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder dir(java.lang.String dir) {
this.dir = dir;
return this;
}
/**
* Sets the value of {@link ImageProps#getBuildArgs}
* @param buildArgs List of build args to pass to the build action.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@SuppressWarnings("unchecked")
public Builder buildArgs(java.util.List extends org.cdk8s.image.BuildArg> buildArgs) {
this.buildArgs = (java.util.List)buildArgs;
return this;
}
/**
* Sets the value of {@link ImageProps#getFile}
* @param file Path to Dockerfile.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder file(java.lang.String file) {
this.file = file;
return this;
}
/**
* Sets the value of {@link ImageProps#getName}
* @param name Name for the image.
* Docker convention is {registry_name}/{name}:{tag}
* Visit https://docs.docker.com/engine/reference/commandline/tag/ for more information
* @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 ImageProps#getPlatform}
* @param platform Set to specify the target platform for the build output, (for example, linux/amd64, linux/arm64, or darwin/amd64).
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder platform(java.lang.String platform) {
this.platform = platform;
return this;
}
/**
* Sets the value of {@link ImageProps#getRegistry}
* @param registry The registry URL to use.
* This will be used as the prefix for the image name.
*
* For example, if you have a local registry listening on port 500, you can set this to localhost:5000
.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder registry(java.lang.String registry) {
this.registry = registry;
return this;
}
/**
* Sets the value of {@link ImageProps#getTag}
* @param tag Tag for the image.
* Docker convention is {registry_name}/{name}:{tag}
* Visit https://docs.docker.com/engine/reference/commandline/tag/ for more information
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder tag(java.lang.String tag) {
this.tag = tag;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link ImageProps}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public ImageProps build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link ImageProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements ImageProps {
private final java.lang.String dir;
private final java.util.List buildArgs;
private final java.lang.String file;
private final java.lang.String name;
private final java.lang.String platform;
private final java.lang.String registry;
private final java.lang.String tag;
/**
* 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.dir = software.amazon.jsii.Kernel.get(this, "dir", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.buildArgs = software.amazon.jsii.Kernel.get(this, "buildArgs", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(org.cdk8s.image.BuildArg.class)));
this.file = software.amazon.jsii.Kernel.get(this, "file", 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.platform = software.amazon.jsii.Kernel.get(this, "platform", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.registry = software.amazon.jsii.Kernel.get(this, "registry", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.tag = software.amazon.jsii.Kernel.get(this, "tag", software.amazon.jsii.NativeType.forClass(java.lang.String.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.dir = java.util.Objects.requireNonNull(builder.dir, "dir is required");
this.buildArgs = (java.util.List)builder.buildArgs;
this.file = builder.file;
this.name = builder.name;
this.platform = builder.platform;
this.registry = builder.registry;
this.tag = builder.tag;
}
@Override
public final java.lang.String getDir() {
return this.dir;
}
@Override
public final java.util.List getBuildArgs() {
return this.buildArgs;
}
@Override
public final java.lang.String getFile() {
return this.file;
}
@Override
public final java.lang.String getName() {
return this.name;
}
@Override
public final java.lang.String getPlatform() {
return this.platform;
}
@Override
public final java.lang.String getRegistry() {
return this.registry;
}
@Override
public final java.lang.String getTag() {
return this.tag;
}
@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();
data.set("dir", om.valueToTree(this.getDir()));
if (this.getBuildArgs() != null) {
data.set("buildArgs", om.valueToTree(this.getBuildArgs()));
}
if (this.getFile() != null) {
data.set("file", om.valueToTree(this.getFile()));
}
if (this.getName() != null) {
data.set("name", om.valueToTree(this.getName()));
}
if (this.getPlatform() != null) {
data.set("platform", om.valueToTree(this.getPlatform()));
}
if (this.getRegistry() != null) {
data.set("registry", om.valueToTree(this.getRegistry()));
}
if (this.getTag() != null) {
data.set("tag", om.valueToTree(this.getTag()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("cdk8s-image.ImageProps"));
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;
ImageProps.Jsii$Proxy that = (ImageProps.Jsii$Proxy) o;
if (!dir.equals(that.dir)) return false;
if (this.buildArgs != null ? !this.buildArgs.equals(that.buildArgs) : that.buildArgs != null) return false;
if (this.file != null ? !this.file.equals(that.file) : that.file != null) return false;
if (this.name != null ? !this.name.equals(that.name) : that.name != null) return false;
if (this.platform != null ? !this.platform.equals(that.platform) : that.platform != null) return false;
if (this.registry != null ? !this.registry.equals(that.registry) : that.registry != null) return false;
return this.tag != null ? this.tag.equals(that.tag) : that.tag == null;
}
@Override
public final int hashCode() {
int result = this.dir.hashCode();
result = 31 * result + (this.buildArgs != null ? this.buildArgs.hashCode() : 0);
result = 31 * result + (this.file != null ? this.file.hashCode() : 0);
result = 31 * result + (this.name != null ? this.name.hashCode() : 0);
result = 31 * result + (this.platform != null ? this.platform.hashCode() : 0);
result = 31 * result + (this.registry != null ? this.registry.hashCode() : 0);
result = 31 * result + (this.tag != null ? this.tag.hashCode() : 0);
return result;
}
}
}