
io.github.cdklabs.projen.GitpodPort Maven / Gradle / Ivy
package io.github.cdklabs.projen;
/**
* (experimental) Options for an exposed port on Gitpod.
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.50.0 (build d1830a4)", date = "2022-01-03T02:39:48.178Z")
@software.amazon.jsii.Jsii(module = io.github.cdklabs.projen.$Module.class, fqn = "projen.GitpodPort")
@software.amazon.jsii.Jsii.Proxy(GitpodPort.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public interface GitpodPort extends software.amazon.jsii.JsiiSerializable {
/**
* (experimental) What to do when a service on a port is detected.
*
* Default: GitpodOnOpen.NOTIFY
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable io.github.cdklabs.projen.GitpodOnOpen getOnOpen() {
return null;
}
/**
* (experimental) A port that should be exposed (forwarded) from the container.
*
* Example:
*
*
* // Example automatically generated from non-compiling source. May contain errors.
* "8080"
*
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.String getPort() {
return null;
}
/**
* (experimental) Whether the port visibility should be private or public.
*
* Default: GitpodPortVisibility.PUBLIC
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable io.github.cdklabs.projen.GitpodPortVisibility getVisibility() {
return null;
}
/**
* @return a {@link Builder} of {@link GitpodPort}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link GitpodPort}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
io.github.cdklabs.projen.GitpodOnOpen onOpen;
java.lang.String port;
io.github.cdklabs.projen.GitpodPortVisibility visibility;
/**
* Sets the value of {@link GitpodPort#getOnOpen}
* @param onOpen What to do when a service on a port is detected.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder onOpen(io.github.cdklabs.projen.GitpodOnOpen onOpen) {
this.onOpen = onOpen;
return this;
}
/**
* Sets the value of {@link GitpodPort#getPort}
* @param port A port that should be exposed (forwarded) from the container.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder port(java.lang.String port) {
this.port = port;
return this;
}
/**
* Sets the value of {@link GitpodPort#getVisibility}
* @param visibility Whether the port visibility should be private or public.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder visibility(io.github.cdklabs.projen.GitpodPortVisibility visibility) {
this.visibility = visibility;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link GitpodPort}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public GitpodPort build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link GitpodPort}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements GitpodPort {
private final io.github.cdklabs.projen.GitpodOnOpen onOpen;
private final java.lang.String port;
private final io.github.cdklabs.projen.GitpodPortVisibility visibility;
/**
* 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.onOpen = software.amazon.jsii.Kernel.get(this, "onOpen", software.amazon.jsii.NativeType.forClass(io.github.cdklabs.projen.GitpodOnOpen.class));
this.port = software.amazon.jsii.Kernel.get(this, "port", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.visibility = software.amazon.jsii.Kernel.get(this, "visibility", software.amazon.jsii.NativeType.forClass(io.github.cdklabs.projen.GitpodPortVisibility.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.onOpen = builder.onOpen;
this.port = builder.port;
this.visibility = builder.visibility;
}
@Override
public final io.github.cdklabs.projen.GitpodOnOpen getOnOpen() {
return this.onOpen;
}
@Override
public final java.lang.String getPort() {
return this.port;
}
@Override
public final io.github.cdklabs.projen.GitpodPortVisibility getVisibility() {
return this.visibility;
}
@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.getOnOpen() != null) {
data.set("onOpen", om.valueToTree(this.getOnOpen()));
}
if (this.getPort() != null) {
data.set("port", om.valueToTree(this.getPort()));
}
if (this.getVisibility() != null) {
data.set("visibility", om.valueToTree(this.getVisibility()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("projen.GitpodPort"));
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;
GitpodPort.Jsii$Proxy that = (GitpodPort.Jsii$Proxy) o;
if (this.onOpen != null ? !this.onOpen.equals(that.onOpen) : that.onOpen != null) return false;
if (this.port != null ? !this.port.equals(that.port) : that.port != null) return false;
return this.visibility != null ? this.visibility.equals(that.visibility) : that.visibility == null;
}
@Override
public final int hashCode() {
int result = this.onOpen != null ? this.onOpen.hashCode() : 0;
result = 31 * result + (this.port != null ? this.port.hashCode() : 0);
result = 31 * result + (this.visibility != null ? this.visibility.hashCode() : 0);
return result;
}
}
}