org.mongodb.awscdk.resources.mongodbatlas.MetricThresholdView Maven / Gradle / Ivy
Show all versions of awscdk-resources-mongodbatlas Show documentation
package org.mongodb.awscdk.resources.mongodbatlas;
/**
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.101.0 (build b95fe5d)", date = "2024-07-30T09:54:29.028Z")
@software.amazon.jsii.Jsii(module = org.mongodb.awscdk.resources.mongodbatlas.$Module.class, fqn = "awscdk-resources-mongodbatlas.MetricThresholdView")
@software.amazon.jsii.Jsii.Proxy(MetricThresholdView.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public interface MetricThresholdView extends software.amazon.jsii.JsiiSerializable {
/**
* Human-readable label that identifies the metric against which MongoDB Cloud checks the configured metricThreshold.threshold.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.String getMetricName() {
return null;
}
/**
* MongoDB Cloud computes the current metric value as an average.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable org.mongodb.awscdk.resources.mongodbatlas.MetricThresholdViewMode getMode() {
return null;
}
/**
* Comparison operator to apply when checking the current metric value.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable org.mongodb.awscdk.resources.mongodbatlas.MetricThresholdViewOperator getOperator() {
return null;
}
/**
* Value of metric that, when exceeded, triggers an alert.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.Number getThreshold() {
return null;
}
/**
* Element used to express the quantity.
*
* This can be an element of time, storage capacity, and the like.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.String getUnits() {
return null;
}
/**
* @return a {@link Builder} of {@link MetricThresholdView}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link MetricThresholdView}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public static final class Builder implements software.amazon.jsii.Builder {
java.lang.String metricName;
org.mongodb.awscdk.resources.mongodbatlas.MetricThresholdViewMode mode;
org.mongodb.awscdk.resources.mongodbatlas.MetricThresholdViewOperator operator;
java.lang.Number threshold;
java.lang.String units;
/**
* Sets the value of {@link MetricThresholdView#getMetricName}
* @param metricName Human-readable label that identifies the metric against which MongoDB Cloud checks the configured metricThreshold.threshold.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder metricName(java.lang.String metricName) {
this.metricName = metricName;
return this;
}
/**
* Sets the value of {@link MetricThresholdView#getMode}
* @param mode MongoDB Cloud computes the current metric value as an average.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder mode(org.mongodb.awscdk.resources.mongodbatlas.MetricThresholdViewMode mode) {
this.mode = mode;
return this;
}
/**
* Sets the value of {@link MetricThresholdView#getOperator}
* @param operator Comparison operator to apply when checking the current metric value.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder operator(org.mongodb.awscdk.resources.mongodbatlas.MetricThresholdViewOperator operator) {
this.operator = operator;
return this;
}
/**
* Sets the value of {@link MetricThresholdView#getThreshold}
* @param threshold Value of metric that, when exceeded, triggers an alert.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder threshold(java.lang.Number threshold) {
this.threshold = threshold;
return this;
}
/**
* Sets the value of {@link MetricThresholdView#getUnits}
* @param units Element used to express the quantity.
* This can be an element of time, storage capacity, and the like.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder units(java.lang.String units) {
this.units = units;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link MetricThresholdView}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public MetricThresholdView build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link MetricThresholdView}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements MetricThresholdView {
private final java.lang.String metricName;
private final org.mongodb.awscdk.resources.mongodbatlas.MetricThresholdViewMode mode;
private final org.mongodb.awscdk.resources.mongodbatlas.MetricThresholdViewOperator operator;
private final java.lang.Number threshold;
private final java.lang.String units;
/**
* 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.metricName = software.amazon.jsii.Kernel.get(this, "metricName", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.mode = software.amazon.jsii.Kernel.get(this, "mode", software.amazon.jsii.NativeType.forClass(org.mongodb.awscdk.resources.mongodbatlas.MetricThresholdViewMode.class));
this.operator = software.amazon.jsii.Kernel.get(this, "operator", software.amazon.jsii.NativeType.forClass(org.mongodb.awscdk.resources.mongodbatlas.MetricThresholdViewOperator.class));
this.threshold = software.amazon.jsii.Kernel.get(this, "threshold", software.amazon.jsii.NativeType.forClass(java.lang.Number.class));
this.units = software.amazon.jsii.Kernel.get(this, "units", 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.metricName = builder.metricName;
this.mode = builder.mode;
this.operator = builder.operator;
this.threshold = builder.threshold;
this.units = builder.units;
}
@Override
public final java.lang.String getMetricName() {
return this.metricName;
}
@Override
public final org.mongodb.awscdk.resources.mongodbatlas.MetricThresholdViewMode getMode() {
return this.mode;
}
@Override
public final org.mongodb.awscdk.resources.mongodbatlas.MetricThresholdViewOperator getOperator() {
return this.operator;
}
@Override
public final java.lang.Number getThreshold() {
return this.threshold;
}
@Override
public final java.lang.String getUnits() {
return this.units;
}
@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();
if (this.getMetricName() != null) {
data.set("metricName", om.valueToTree(this.getMetricName()));
}
if (this.getMode() != null) {
data.set("mode", om.valueToTree(this.getMode()));
}
if (this.getOperator() != null) {
data.set("operator", om.valueToTree(this.getOperator()));
}
if (this.getThreshold() != null) {
data.set("threshold", om.valueToTree(this.getThreshold()));
}
if (this.getUnits() != null) {
data.set("units", om.valueToTree(this.getUnits()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("awscdk-resources-mongodbatlas.MetricThresholdView"));
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;
MetricThresholdView.Jsii$Proxy that = (MetricThresholdView.Jsii$Proxy) o;
if (this.metricName != null ? !this.metricName.equals(that.metricName) : that.metricName != null) return false;
if (this.mode != null ? !this.mode.equals(that.mode) : that.mode != null) return false;
if (this.operator != null ? !this.operator.equals(that.operator) : that.operator != null) return false;
if (this.threshold != null ? !this.threshold.equals(that.threshold) : that.threshold != null) return false;
return this.units != null ? this.units.equals(that.units) : that.units == null;
}
@Override
public final int hashCode() {
int result = this.metricName != null ? this.metricName.hashCode() : 0;
result = 31 * result + (this.mode != null ? this.mode.hashCode() : 0);
result = 31 * result + (this.operator != null ? this.operator.hashCode() : 0);
result = 31 * result + (this.threshold != null ? this.threshold.hashCode() : 0);
result = 31 * result + (this.units != null ? this.units.hashCode() : 0);
return result;
}
}
}