tech.condense.cdkconstructs.AlarmDefinitionProps Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cdkconstructs Show documentation
Show all versions of cdkconstructs Show documentation
Condense's opinionated constructs and stacks for AWS CDK
package tech.condense.cdkconstructs;
/**
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.102.0 (build e354887)", date = "2024-08-29T09:27:04.518Z")
@software.amazon.jsii.Jsii(module = tech.condense.cdkconstructs.$Module.class, fqn = "@condensetech/cdk-constructs.AlarmDefinitionProps")
@software.amazon.jsii.Jsii.Proxy(AlarmDefinitionProps.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public interface AlarmDefinitionProps extends software.amazon.jsii.JsiiSerializable {
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@org.jetbrains.annotations.NotNull java.lang.String getAlarmId();
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@org.jetbrains.annotations.NotNull java.lang.Number getEvaluationPeriods();
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@org.jetbrains.annotations.NotNull software.amazon.awscdk.services.cloudwatch.IMetric getMetric();
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.String getAlarmDescription() {
return null;
}
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.String getAlarmName() {
return null;
}
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.cloudwatch.ComparisonOperator getComparisonOperator() {
return null;
}
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.Number getThreshold() {
return null;
}
/**
* @return a {@link Builder} of {@link AlarmDefinitionProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link AlarmDefinitionProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
java.lang.String alarmId;
java.lang.Number evaluationPeriods;
software.amazon.awscdk.services.cloudwatch.IMetric metric;
java.lang.String alarmDescription;
java.lang.String alarmName;
software.amazon.awscdk.services.cloudwatch.ComparisonOperator comparisonOperator;
java.lang.Number threshold;
/**
* Sets the value of {@link AlarmDefinitionProps#getAlarmId}
* @param alarmId the value to be set. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder alarmId(java.lang.String alarmId) {
this.alarmId = alarmId;
return this;
}
/**
* Sets the value of {@link AlarmDefinitionProps#getEvaluationPeriods}
* @param evaluationPeriods the value to be set. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder evaluationPeriods(java.lang.Number evaluationPeriods) {
this.evaluationPeriods = evaluationPeriods;
return this;
}
/**
* Sets the value of {@link AlarmDefinitionProps#getMetric}
* @param metric the value to be set. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder metric(software.amazon.awscdk.services.cloudwatch.IMetric metric) {
this.metric = metric;
return this;
}
/**
* Sets the value of {@link AlarmDefinitionProps#getAlarmDescription}
* @param alarmDescription the value to be set.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder alarmDescription(java.lang.String alarmDescription) {
this.alarmDescription = alarmDescription;
return this;
}
/**
* Sets the value of {@link AlarmDefinitionProps#getAlarmName}
* @param alarmName the value to be set.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder alarmName(java.lang.String alarmName) {
this.alarmName = alarmName;
return this;
}
/**
* Sets the value of {@link AlarmDefinitionProps#getComparisonOperator}
* @param comparisonOperator the value to be set.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder comparisonOperator(software.amazon.awscdk.services.cloudwatch.ComparisonOperator comparisonOperator) {
this.comparisonOperator = comparisonOperator;
return this;
}
/**
* Sets the value of {@link AlarmDefinitionProps#getThreshold}
* @param threshold the value to be set.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder threshold(java.lang.Number threshold) {
this.threshold = threshold;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link AlarmDefinitionProps}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public AlarmDefinitionProps build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link AlarmDefinitionProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements AlarmDefinitionProps {
private final java.lang.String alarmId;
private final java.lang.Number evaluationPeriods;
private final software.amazon.awscdk.services.cloudwatch.IMetric metric;
private final java.lang.String alarmDescription;
private final java.lang.String alarmName;
private final software.amazon.awscdk.services.cloudwatch.ComparisonOperator comparisonOperator;
private final java.lang.Number threshold;
/**
* 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.alarmId = software.amazon.jsii.Kernel.get(this, "alarmId", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.evaluationPeriods = software.amazon.jsii.Kernel.get(this, "evaluationPeriods", software.amazon.jsii.NativeType.forClass(java.lang.Number.class));
this.metric = software.amazon.jsii.Kernel.get(this, "metric", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.cloudwatch.IMetric.class));
this.alarmDescription = software.amazon.jsii.Kernel.get(this, "alarmDescription", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.alarmName = software.amazon.jsii.Kernel.get(this, "alarmName", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.comparisonOperator = software.amazon.jsii.Kernel.get(this, "comparisonOperator", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.cloudwatch.ComparisonOperator.class));
this.threshold = software.amazon.jsii.Kernel.get(this, "threshold", software.amazon.jsii.NativeType.forClass(java.lang.Number.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.alarmId = java.util.Objects.requireNonNull(builder.alarmId, "alarmId is required");
this.evaluationPeriods = java.util.Objects.requireNonNull(builder.evaluationPeriods, "evaluationPeriods is required");
this.metric = java.util.Objects.requireNonNull(builder.metric, "metric is required");
this.alarmDescription = builder.alarmDescription;
this.alarmName = builder.alarmName;
this.comparisonOperator = builder.comparisonOperator;
this.threshold = builder.threshold;
}
@Override
public final java.lang.String getAlarmId() {
return this.alarmId;
}
@Override
public final java.lang.Number getEvaluationPeriods() {
return this.evaluationPeriods;
}
@Override
public final software.amazon.awscdk.services.cloudwatch.IMetric getMetric() {
return this.metric;
}
@Override
public final java.lang.String getAlarmDescription() {
return this.alarmDescription;
}
@Override
public final java.lang.String getAlarmName() {
return this.alarmName;
}
@Override
public final software.amazon.awscdk.services.cloudwatch.ComparisonOperator getComparisonOperator() {
return this.comparisonOperator;
}
@Override
public final java.lang.Number getThreshold() {
return this.threshold;
}
@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("alarmId", om.valueToTree(this.getAlarmId()));
data.set("evaluationPeriods", om.valueToTree(this.getEvaluationPeriods()));
data.set("metric", om.valueToTree(this.getMetric()));
if (this.getAlarmDescription() != null) {
data.set("alarmDescription", om.valueToTree(this.getAlarmDescription()));
}
if (this.getAlarmName() != null) {
data.set("alarmName", om.valueToTree(this.getAlarmName()));
}
if (this.getComparisonOperator() != null) {
data.set("comparisonOperator", om.valueToTree(this.getComparisonOperator()));
}
if (this.getThreshold() != null) {
data.set("threshold", om.valueToTree(this.getThreshold()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("@condensetech/cdk-constructs.AlarmDefinitionProps"));
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;
AlarmDefinitionProps.Jsii$Proxy that = (AlarmDefinitionProps.Jsii$Proxy) o;
if (!alarmId.equals(that.alarmId)) return false;
if (!evaluationPeriods.equals(that.evaluationPeriods)) return false;
if (!metric.equals(that.metric)) return false;
if (this.alarmDescription != null ? !this.alarmDescription.equals(that.alarmDescription) : that.alarmDescription != null) return false;
if (this.alarmName != null ? !this.alarmName.equals(that.alarmName) : that.alarmName != null) return false;
if (this.comparisonOperator != null ? !this.comparisonOperator.equals(that.comparisonOperator) : that.comparisonOperator != null) return false;
return this.threshold != null ? this.threshold.equals(that.threshold) : that.threshold == null;
}
@Override
public final int hashCode() {
int result = this.alarmId.hashCode();
result = 31 * result + (this.evaluationPeriods.hashCode());
result = 31 * result + (this.metric.hashCode());
result = 31 * result + (this.alarmDescription != null ? this.alarmDescription.hashCode() : 0);
result = 31 * result + (this.alarmName != null ? this.alarmName.hashCode() : 0);
result = 31 * result + (this.comparisonOperator != null ? this.comparisonOperator.hashCode() : 0);
result = 31 * result + (this.threshold != null ? this.threshold.hashCode() : 0);
return result;
}
}
}