org.mongodb.awscdk.resources.mongodbatlas.IntegerThresholdView 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.024Z")
@software.amazon.jsii.Jsii(module = org.mongodb.awscdk.resources.mongodbatlas.$Module.class, fqn = "awscdk-resources-mongodbatlas.IntegerThresholdView")
@software.amazon.jsii.Jsii.Proxy(IntegerThresholdView.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public interface IntegerThresholdView extends software.amazon.jsii.JsiiSerializable {
/**
* 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.IntegerThresholdViewOperator 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 IntegerThresholdView}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link IntegerThresholdView}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public static final class Builder implements software.amazon.jsii.Builder {
org.mongodb.awscdk.resources.mongodbatlas.IntegerThresholdViewOperator operator;
java.lang.Number threshold;
java.lang.String units;
/**
* Sets the value of {@link IntegerThresholdView#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.IntegerThresholdViewOperator operator) {
this.operator = operator;
return this;
}
/**
* Sets the value of {@link IntegerThresholdView#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 IntegerThresholdView#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 IntegerThresholdView}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public IntegerThresholdView build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link IntegerThresholdView}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements IntegerThresholdView {
private final org.mongodb.awscdk.resources.mongodbatlas.IntegerThresholdViewOperator 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.operator = software.amazon.jsii.Kernel.get(this, "operator", software.amazon.jsii.NativeType.forClass(org.mongodb.awscdk.resources.mongodbatlas.IntegerThresholdViewOperator.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.operator = builder.operator;
this.threshold = builder.threshold;
this.units = builder.units;
}
@Override
public final org.mongodb.awscdk.resources.mongodbatlas.IntegerThresholdViewOperator 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.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.IntegerThresholdView"));
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;
IntegerThresholdView.Jsii$Proxy that = (IntegerThresholdView.Jsii$Proxy) o;
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.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;
}
}
}