software.aws.awsprototypingsdk.cdkgraph.ConstructInfo Maven / Gradle / Ivy
Show all versions of cdk-graph Show documentation
package software.aws.awsprototypingsdk.cdkgraph;
/**
* (experimental) Source information on a construct (class fqn and version).
*
* @see https://github.com/aws/aws-cdk/blob/cea1039e3664fdfa89c6f00cdaeb1a0185a12678/packages/%40aws-cdk/core/lib/private/runtime-info.ts#L22
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.82.0 (build 2d2ddd7)", date = "2023-08-15T05:45:13.680Z")
@software.amazon.jsii.Jsii(module = software.aws.awsprototypingsdk.cdkgraph.$Module.class, fqn = "@aws-prototyping-sdk/cdk-graph.ConstructInfo")
@software.amazon.jsii.Jsii.Proxy(ConstructInfo.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public interface ConstructInfo extends software.amazon.jsii.JsiiSerializable {
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@org.jetbrains.annotations.NotNull java.lang.String getFqn();
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@org.jetbrains.annotations.NotNull java.lang.String getVersion();
/**
* @return a {@link Builder} of {@link ConstructInfo}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link ConstructInfo}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
java.lang.String fqn;
java.lang.String version;
/**
* Sets the value of {@link ConstructInfo#getFqn}
* @param fqn the value to be set. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder fqn(java.lang.String fqn) {
this.fqn = fqn;
return this;
}
/**
* Sets the value of {@link ConstructInfo#getVersion}
* @param version the value to be set. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder version(java.lang.String version) {
this.version = version;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link ConstructInfo}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public ConstructInfo build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link ConstructInfo}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements ConstructInfo {
private final java.lang.String fqn;
private final java.lang.String version;
/**
* 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.fqn = software.amazon.jsii.Kernel.get(this, "fqn", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.version = software.amazon.jsii.Kernel.get(this, "version", 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 Builder builder) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
this.fqn = java.util.Objects.requireNonNull(builder.fqn, "fqn is required");
this.version = java.util.Objects.requireNonNull(builder.version, "version is required");
}
@Override
public final java.lang.String getFqn() {
return this.fqn;
}
@Override
public final java.lang.String getVersion() {
return this.version;
}
@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("fqn", om.valueToTree(this.getFqn()));
data.set("version", om.valueToTree(this.getVersion()));
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("@aws-prototyping-sdk/cdk-graph.ConstructInfo"));
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;
ConstructInfo.Jsii$Proxy that = (ConstructInfo.Jsii$Proxy) o;
if (!fqn.equals(that.fqn)) return false;
return this.version.equals(that.version);
}
@Override
public final int hashCode() {
int result = this.fqn.hashCode();
result = 31 * result + (this.version.hashCode());
return result;
}
}
}