software.aws.awsprototypingsdk.cdkgraph.SGEntity Maven / Gradle / Ivy
Show all versions of cdk-graph Show documentation
package software.aws.awsprototypingsdk.cdkgraph;
/**
* (experimental) Serializable graph entity.
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.82.0 (build 2d2ddd7)", date = "2023-08-15T05:45:13.821Z")
@software.amazon.jsii.Jsii(module = software.aws.awsprototypingsdk.cdkgraph.$Module.class, fqn = "@aws-prototyping-sdk/cdk-graph.SGEntity")
@software.amazon.jsii.Jsii.Proxy(SGEntity.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public interface SGEntity extends software.amazon.jsii.JsiiSerializable {
/**
* (experimental) Universally unique identity.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@org.jetbrains.annotations.NotNull java.lang.String getUuid();
/**
* (experimental) Serializable entity attributes.
*
* @see {@link Attributes }
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.util.Map getAttributes() {
return null;
}
/**
* (experimental) Serializable entity flags.
*
* @see {@link FlagEnum }
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.util.List getFlags() {
return null;
}
/**
* (experimental) Serializable entity metadata.
*
* @see {@link Metadata }
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.util.List getMetadata() {
return null;
}
/**
* (experimental) Serializable entity tags.
*
* @see {@link Tags }
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.util.Map getTags() {
return null;
}
/**
* @return a {@link Builder} of {@link SGEntity}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link SGEntity}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
java.lang.String uuid;
java.util.Map attributes;
java.util.List flags;
java.util.List metadata;
java.util.Map tags;
/**
* Sets the value of {@link SGEntity#getUuid}
* @param uuid Universally unique identity. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder uuid(java.lang.String uuid) {
this.uuid = uuid;
return this;
}
/**
* Sets the value of {@link SGEntity#getAttributes}
* @param attributes Serializable entity attributes.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@SuppressWarnings("unchecked")
public Builder attributes(java.util.Map attributes) {
this.attributes = (java.util.Map)attributes;
return this;
}
/**
* Sets the value of {@link SGEntity#getFlags}
* @param flags Serializable entity flags.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@SuppressWarnings("unchecked")
public Builder flags(java.util.List extends software.aws.awsprototypingsdk.cdkgraph.FlagEnum> flags) {
this.flags = (java.util.List)flags;
return this;
}
/**
* Sets the value of {@link SGEntity#getMetadata}
* @param metadata Serializable entity metadata.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@SuppressWarnings("unchecked")
public Builder metadata(java.util.List extends software.constructs.MetadataEntry> metadata) {
this.metadata = (java.util.List)metadata;
return this;
}
/**
* Sets the value of {@link SGEntity#getTags}
* @param tags Serializable entity tags.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder tags(java.util.Map tags) {
this.tags = tags;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link SGEntity}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public SGEntity build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link SGEntity}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements SGEntity {
private final java.lang.String uuid;
private final java.util.Map attributes;
private final java.util.List flags;
private final java.util.List metadata;
private final java.util.Map tags;
/**
* 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.uuid = software.amazon.jsii.Kernel.get(this, "uuid", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.attributes = software.amazon.jsii.Kernel.get(this, "attributes", software.amazon.jsii.NativeType.mapOf(software.amazon.jsii.NativeType.forClass(java.lang.Object.class)));
this.flags = software.amazon.jsii.Kernel.get(this, "flags", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(software.aws.awsprototypingsdk.cdkgraph.FlagEnum.class)));
this.metadata = software.amazon.jsii.Kernel.get(this, "metadata", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(software.constructs.MetadataEntry.class)));
this.tags = software.amazon.jsii.Kernel.get(this, "tags", software.amazon.jsii.NativeType.mapOf(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.uuid = java.util.Objects.requireNonNull(builder.uuid, "uuid is required");
this.attributes = (java.util.Map)builder.attributes;
this.flags = (java.util.List)builder.flags;
this.metadata = (java.util.List)builder.metadata;
this.tags = builder.tags;
}
@Override
public final java.lang.String getUuid() {
return this.uuid;
}
@Override
public final java.util.Map getAttributes() {
return this.attributes;
}
@Override
public final java.util.List getFlags() {
return this.flags;
}
@Override
public final java.util.List getMetadata() {
return this.metadata;
}
@Override
public final java.util.Map getTags() {
return this.tags;
}
@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("uuid", om.valueToTree(this.getUuid()));
if (this.getAttributes() != null) {
data.set("attributes", om.valueToTree(this.getAttributes()));
}
if (this.getFlags() != null) {
data.set("flags", om.valueToTree(this.getFlags()));
}
if (this.getMetadata() != null) {
data.set("metadata", om.valueToTree(this.getMetadata()));
}
if (this.getTags() != null) {
data.set("tags", om.valueToTree(this.getTags()));
}
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.SGEntity"));
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;
SGEntity.Jsii$Proxy that = (SGEntity.Jsii$Proxy) o;
if (!uuid.equals(that.uuid)) return false;
if (this.attributes != null ? !this.attributes.equals(that.attributes) : that.attributes != null) return false;
if (this.flags != null ? !this.flags.equals(that.flags) : that.flags != null) return false;
if (this.metadata != null ? !this.metadata.equals(that.metadata) : that.metadata != null) return false;
return this.tags != null ? this.tags.equals(that.tags) : that.tags == null;
}
@Override
public final int hashCode() {
int result = this.uuid.hashCode();
result = 31 * result + (this.attributes != null ? this.attributes.hashCode() : 0);
result = 31 * result + (this.flags != null ? this.flags.hashCode() : 0);
result = 31 * result + (this.metadata != null ? this.metadata.hashCode() : 0);
result = 31 * result + (this.tags != null ? this.tags.hashCode() : 0);
return result;
}
}
}