org.mongodb.awscdk.resources.mongodbatlas.ManagedNamespace 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.026Z")
@software.amazon.jsii.Jsii(module = org.mongodb.awscdk.resources.mongodbatlas.$Module.class, fqn = "awscdk-resources-mongodbatlas.ManagedNamespace")
@software.amazon.jsii.Jsii.Proxy(ManagedNamespace.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public interface ManagedNamespace extends software.amazon.jsii.JsiiSerializable {
/**
* Human-readable label of the collection to manage for this Global Cluster.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.String getCollection() {
return null;
}
/**
* Database parameter used to divide the collection into shards.
*
* Global clusters require a compound shard key. This compound shard key combines the location parameter and the user-selected custom key.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.String getCustomShardKey() {
return null;
}
/**
* Human-readable label of the database to manage for this Global Cluster.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.String getDb() {
return null;
}
/**
* Flag that indicates whether someone hashed the custom shard key for the specified collection.
*
* If you set this value to false
, MongoDB Cloud uses ranged sharding.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.Boolean getIsCustomShardKeyHashed() {
return null;
}
/**
* Flag that indicates whether someone hashed the custom shard key. If this parameter returns false
, this cluster uses ranged sharding.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.Boolean getIsShardKeyUnique() {
return null;
}
/**
* @return a {@link Builder} of {@link ManagedNamespace}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link ManagedNamespace}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public static final class Builder implements software.amazon.jsii.Builder {
java.lang.String collection;
java.lang.String customShardKey;
java.lang.String db;
java.lang.Boolean isCustomShardKeyHashed;
java.lang.Boolean isShardKeyUnique;
/**
* Sets the value of {@link ManagedNamespace#getCollection}
* @param collection Human-readable label of the collection to manage for this Global Cluster.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder collection(java.lang.String collection) {
this.collection = collection;
return this;
}
/**
* Sets the value of {@link ManagedNamespace#getCustomShardKey}
* @param customShardKey Database parameter used to divide the collection into shards.
* Global clusters require a compound shard key. This compound shard key combines the location parameter and the user-selected custom key.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder customShardKey(java.lang.String customShardKey) {
this.customShardKey = customShardKey;
return this;
}
/**
* Sets the value of {@link ManagedNamespace#getDb}
* @param db Human-readable label of the database to manage for this Global Cluster.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder db(java.lang.String db) {
this.db = db;
return this;
}
/**
* Sets the value of {@link ManagedNamespace#getIsCustomShardKeyHashed}
* @param isCustomShardKeyHashed Flag that indicates whether someone hashed the custom shard key for the specified collection.
* If you set this value to false
, MongoDB Cloud uses ranged sharding.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder isCustomShardKeyHashed(java.lang.Boolean isCustomShardKeyHashed) {
this.isCustomShardKeyHashed = isCustomShardKeyHashed;
return this;
}
/**
* Sets the value of {@link ManagedNamespace#getIsShardKeyUnique}
* @param isShardKeyUnique Flag that indicates whether someone hashed the custom shard key. If this parameter returns false
, this cluster uses ranged sharding.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder isShardKeyUnique(java.lang.Boolean isShardKeyUnique) {
this.isShardKeyUnique = isShardKeyUnique;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link ManagedNamespace}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public ManagedNamespace build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link ManagedNamespace}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements ManagedNamespace {
private final java.lang.String collection;
private final java.lang.String customShardKey;
private final java.lang.String db;
private final java.lang.Boolean isCustomShardKeyHashed;
private final java.lang.Boolean isShardKeyUnique;
/**
* 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.collection = software.amazon.jsii.Kernel.get(this, "collection", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.customShardKey = software.amazon.jsii.Kernel.get(this, "customShardKey", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.db = software.amazon.jsii.Kernel.get(this, "db", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.isCustomShardKeyHashed = software.amazon.jsii.Kernel.get(this, "isCustomShardKeyHashed", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.class));
this.isShardKeyUnique = software.amazon.jsii.Kernel.get(this, "isShardKeyUnique", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.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.collection = builder.collection;
this.customShardKey = builder.customShardKey;
this.db = builder.db;
this.isCustomShardKeyHashed = builder.isCustomShardKeyHashed;
this.isShardKeyUnique = builder.isShardKeyUnique;
}
@Override
public final java.lang.String getCollection() {
return this.collection;
}
@Override
public final java.lang.String getCustomShardKey() {
return this.customShardKey;
}
@Override
public final java.lang.String getDb() {
return this.db;
}
@Override
public final java.lang.Boolean getIsCustomShardKeyHashed() {
return this.isCustomShardKeyHashed;
}
@Override
public final java.lang.Boolean getIsShardKeyUnique() {
return this.isShardKeyUnique;
}
@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.getCollection() != null) {
data.set("collection", om.valueToTree(this.getCollection()));
}
if (this.getCustomShardKey() != null) {
data.set("customShardKey", om.valueToTree(this.getCustomShardKey()));
}
if (this.getDb() != null) {
data.set("db", om.valueToTree(this.getDb()));
}
if (this.getIsCustomShardKeyHashed() != null) {
data.set("isCustomShardKeyHashed", om.valueToTree(this.getIsCustomShardKeyHashed()));
}
if (this.getIsShardKeyUnique() != null) {
data.set("isShardKeyUnique", om.valueToTree(this.getIsShardKeyUnique()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("awscdk-resources-mongodbatlas.ManagedNamespace"));
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;
ManagedNamespace.Jsii$Proxy that = (ManagedNamespace.Jsii$Proxy) o;
if (this.collection != null ? !this.collection.equals(that.collection) : that.collection != null) return false;
if (this.customShardKey != null ? !this.customShardKey.equals(that.customShardKey) : that.customShardKey != null) return false;
if (this.db != null ? !this.db.equals(that.db) : that.db != null) return false;
if (this.isCustomShardKeyHashed != null ? !this.isCustomShardKeyHashed.equals(that.isCustomShardKeyHashed) : that.isCustomShardKeyHashed != null) return false;
return this.isShardKeyUnique != null ? this.isShardKeyUnique.equals(that.isShardKeyUnique) : that.isShardKeyUnique == null;
}
@Override
public final int hashCode() {
int result = this.collection != null ? this.collection.hashCode() : 0;
result = 31 * result + (this.customShardKey != null ? this.customShardKey.hashCode() : 0);
result = 31 * result + (this.db != null ? this.db.hashCode() : 0);
result = 31 * result + (this.isCustomShardKeyHashed != null ? this.isCustomShardKeyHashed.hashCode() : 0);
result = 31 * result + (this.isShardKeyUnique != null ? this.isShardKeyUnique.hashCode() : 0);
return result;
}
}
}