de.sebastianhesse.examples.projen.test.StructProperties Maven / Gradle / Ivy
package de.sebastianhesse.examples.projen.test;
/**
* This interface is translated into a _struct_ containing data.
*
* E.g. if translated to Java, an interface StructProperties
is created containing a builder subclass to create an instance of the interface.
*
* @see https://aws.github.io/jsii/user-guides/lib-author/typescript-restrictions/#interfaces
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.32.0 (build 3f4fe23)", date = "2021-08-16T03:24:17.798Z")
@software.amazon.jsii.Jsii(module = de.sebastianhesse.examples.projen.test.$Module.class, fqn = "@seeebiii/projen-test.StructProperties")
@software.amazon.jsii.Jsii.Proxy(StructProperties.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public interface StructProperties extends software.amazon.jsii.JsiiSerializable {
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@org.jetbrains.annotations.NotNull java.lang.String getMyProp();
/**
* @return a {@link Builder} of {@link StructProperties}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link StructProperties}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public static final class Builder implements software.amazon.jsii.Builder {
private java.lang.String myProp;
/**
* Sets the value of {@link StructProperties#getMyProp}
* @param myProp the value to be set. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder myProp(java.lang.String myProp) {
this.myProp = myProp;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link StructProperties}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public StructProperties build() {
return new Jsii$Proxy(myProp);
}
}
/**
* An implementation for {@link StructProperties}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements StructProperties {
private final java.lang.String myProp;
/**
* 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.myProp = software.amazon.jsii.Kernel.get(this, "myProp", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
}
/**
* Constructor that initializes the object based on literal property values passed by the {@link Builder}.
*/
protected Jsii$Proxy(final java.lang.String myProp) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
this.myProp = java.util.Objects.requireNonNull(myProp, "myProp is required");
}
@Override
public final java.lang.String getMyProp() {
return this.myProp;
}
@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("myProp", om.valueToTree(this.getMyProp()));
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("@seeebiii/projen-test.StructProperties"));
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;
StructProperties.Jsii$Proxy that = (StructProperties.Jsii$Proxy) o;
return this.myProp.equals(that.myProp);
}
@Override
public final int hashCode() {
int result = this.myProp.hashCode();
return result;
}
}
}