software.aws.awsprototypingsdk.pdknag.NagResult Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pdk-nag Show documentation
Show all versions of pdk-nag Show documentation
@aws-prototyping-sdk/pdk-nag
The newest version!
package software.aws.awsprototypingsdk.pdknag;
/**
* Nag result.
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.82.0 (build 2d2ddd7)", date = "2023-08-24T22:55:30.284Z")
@software.amazon.jsii.Jsii(module = software.aws.awsprototypingsdk.pdknag.$Module.class, fqn = "@aws-prototyping-sdk/pdk-nag.NagResult")
@software.amazon.jsii.Jsii.Proxy(NagResult.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public interface NagResult extends software.amazon.jsii.JsiiSerializable {
/**
* List of messages.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@org.jetbrains.annotations.NotNull java.util.List getMessages();
/**
* Resource which triggered the message.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@org.jetbrains.annotations.NotNull java.lang.String getResource();
/**
* @return a {@link Builder} of {@link NagResult}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link NagResult}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public static final class Builder implements software.amazon.jsii.Builder {
java.util.List messages;
java.lang.String resource;
/**
* Sets the value of {@link NagResult#getMessages}
* @param messages List of messages. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@SuppressWarnings("unchecked")
public Builder messages(java.util.List extends software.aws.awsprototypingsdk.pdknag.Message> messages) {
this.messages = (java.util.List)messages;
return this;
}
/**
* Sets the value of {@link NagResult#getResource}
* @param resource Resource which triggered the message. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder resource(java.lang.String resource) {
this.resource = resource;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link NagResult}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public NagResult build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link NagResult}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements NagResult {
private final java.util.List messages;
private final java.lang.String resource;
/**
* 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.messages = software.amazon.jsii.Kernel.get(this, "messages", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(software.aws.awsprototypingsdk.pdknag.Message.class)));
this.resource = software.amazon.jsii.Kernel.get(this, "resource", 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.messages = (java.util.List)java.util.Objects.requireNonNull(builder.messages, "messages is required");
this.resource = java.util.Objects.requireNonNull(builder.resource, "resource is required");
}
@Override
public final java.util.List getMessages() {
return this.messages;
}
@Override
public final java.lang.String getResource() {
return this.resource;
}
@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("messages", om.valueToTree(this.getMessages()));
data.set("resource", om.valueToTree(this.getResource()));
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("@aws-prototyping-sdk/pdk-nag.NagResult"));
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;
NagResult.Jsii$Proxy that = (NagResult.Jsii$Proxy) o;
if (!messages.equals(that.messages)) return false;
return this.resource.equals(that.resource);
}
@Override
public final int hashCode() {
int result = this.messages.hashCode();
result = 31 * result + (this.resource.hashCode());
return result;
}
}
}