org.cdk8s.redis.Redis Maven / Gradle / Ivy
Show all versions of cdk8s-redis Show documentation
package org.cdk8s.redis;
/**
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.103.1 (build bef2dea)", date = "2024-09-27T12:16:50.235Z")
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Jsii(module = org.cdk8s.redis.$Module.class, fqn = "cdk8s-redis.Redis")
public class Redis extends software.constructs.Construct {
protected Redis(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
}
protected Redis(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) {
super(initializationMode);
}
/**
* @param scope This parameter is required.
* @param id This parameter is required.
* @param options
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Redis(final @org.jetbrains.annotations.NotNull software.constructs.Construct scope, final @org.jetbrains.annotations.NotNull java.lang.String id, final @org.jetbrains.annotations.Nullable org.cdk8s.redis.RedisOptions options) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(scope, "scope is required"), java.util.Objects.requireNonNull(id, "id is required"), options });
}
/**
* @param scope This parameter is required.
* @param id This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Redis(final @org.jetbrains.annotations.NotNull software.constructs.Construct scope, final @org.jetbrains.annotations.NotNull java.lang.String id) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(scope, "scope is required"), java.util.Objects.requireNonNull(id, "id is required") });
}
/**
* (experimental) The DNS host for the primary service.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.NotNull java.lang.String getPrimaryHost() {
return software.amazon.jsii.Kernel.get(this, "primaryHost", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
}
/**
* (experimental) The DNS host for the replica service.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.NotNull java.lang.String getReplicaHost() {
return software.amazon.jsii.Kernel.get(this, "replicaHost", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
}
/**
* (experimental) A fluent builder for {@link org.cdk8s.redis.Redis}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
/**
* @return a new instance of {@link Builder}.
* @param scope This parameter is required.
* @param id This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static Builder create(final software.constructs.Construct scope, final java.lang.String id) {
return new Builder(scope, id);
}
private final software.constructs.Construct scope;
private final java.lang.String id;
private org.cdk8s.redis.RedisOptions.Builder options;
private Builder(final software.constructs.Construct scope, final java.lang.String id) {
this.scope = scope;
this.id = id;
}
/**
* (experimental) Extra labels to associate with resources.
*
* Default: - none
*
* @return {@code this}
* @param labels Extra labels to associate with resources. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder labels(final java.util.Map labels) {
this.options().labels(labels);
return this;
}
/**
* (experimental) Number of replicas.
*
* Default: 2
*
* @return {@code this}
* @param replicas Number of replicas. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder replicas(final java.lang.Number replicas) {
this.options().replicas(replicas);
return this;
}
/**
* @return a newly built instance of {@link org.cdk8s.redis.Redis}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public org.cdk8s.redis.Redis build() {
return new org.cdk8s.redis.Redis(
this.scope,
this.id,
this.options != null ? this.options.build() : null
);
}
private org.cdk8s.redis.RedisOptions.Builder options() {
if (this.options == null) {
this.options = new org.cdk8s.redis.RedisOptions.Builder();
}
return this.options;
}
}
}