software.amazon.awscdk.services.redshift.alpha.ClusterAttributes Maven / Gradle / Ivy
Show all versions of redshift-alpha Show documentation
package software.amazon.awscdk.services.redshift.alpha;
/**
* (experimental) Properties that describe an existing cluster instance.
*
* Example:
*
*
* // The code below shows an example of how to instantiate this type.
* // The values are placeholders you should change.
* import software.amazon.awscdk.services.redshift.alpha.*;
* import software.amazon.awscdk.services.ec2.*;
* SecurityGroup securityGroup;
* ClusterAttributes clusterAttributes = ClusterAttributes.builder()
* .clusterEndpointAddress("clusterEndpointAddress")
* .clusterEndpointPort(123)
* .clusterName("clusterName")
* // the properties below are optional
* .securityGroups(List.of(securityGroup))
* .build();
*
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.104.0 (build e79254c)", date = "2024-11-13T21:17:43.413Z")
@software.amazon.jsii.Jsii(module = software.amazon.awscdk.services.redshift.alpha.$Module.class, fqn = "@aws-cdk/aws-redshift-alpha.ClusterAttributes")
@software.amazon.jsii.Jsii.Proxy(ClusterAttributes.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public interface ClusterAttributes extends software.amazon.jsii.JsiiSerializable {
/**
* (experimental) Cluster endpoint address.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@org.jetbrains.annotations.NotNull java.lang.String getClusterEndpointAddress();
/**
* (experimental) Cluster endpoint port.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@org.jetbrains.annotations.NotNull java.lang.Number getClusterEndpointPort();
/**
* (experimental) Identifier for the cluster.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@org.jetbrains.annotations.NotNull java.lang.String getClusterName();
/**
* (experimental) The security groups of the redshift cluster.
*
* Default: no security groups will be attached to the import
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.util.List getSecurityGroups() {
return null;
}
/**
* @return a {@link Builder} of {@link ClusterAttributes}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link ClusterAttributes}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
java.lang.String clusterEndpointAddress;
java.lang.Number clusterEndpointPort;
java.lang.String clusterName;
java.util.List securityGroups;
/**
* Sets the value of {@link ClusterAttributes#getClusterEndpointAddress}
* @param clusterEndpointAddress Cluster endpoint address. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder clusterEndpointAddress(java.lang.String clusterEndpointAddress) {
this.clusterEndpointAddress = clusterEndpointAddress;
return this;
}
/**
* Sets the value of {@link ClusterAttributes#getClusterEndpointPort}
* @param clusterEndpointPort Cluster endpoint port. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder clusterEndpointPort(java.lang.Number clusterEndpointPort) {
this.clusterEndpointPort = clusterEndpointPort;
return this;
}
/**
* Sets the value of {@link ClusterAttributes#getClusterName}
* @param clusterName Identifier for the cluster. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder clusterName(java.lang.String clusterName) {
this.clusterName = clusterName;
return this;
}
/**
* Sets the value of {@link ClusterAttributes#getSecurityGroups}
* @param securityGroups The security groups of the redshift cluster.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@SuppressWarnings("unchecked")
public Builder securityGroups(java.util.List extends software.amazon.awscdk.services.ec2.ISecurityGroup> securityGroups) {
this.securityGroups = (java.util.List)securityGroups;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link ClusterAttributes}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public ClusterAttributes build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link ClusterAttributes}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements ClusterAttributes {
private final java.lang.String clusterEndpointAddress;
private final java.lang.Number clusterEndpointPort;
private final java.lang.String clusterName;
private final java.util.List securityGroups;
/**
* 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.clusterEndpointAddress = software.amazon.jsii.Kernel.get(this, "clusterEndpointAddress", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.clusterEndpointPort = software.amazon.jsii.Kernel.get(this, "clusterEndpointPort", software.amazon.jsii.NativeType.forClass(java.lang.Number.class));
this.clusterName = software.amazon.jsii.Kernel.get(this, "clusterName", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.securityGroups = software.amazon.jsii.Kernel.get(this, "securityGroups", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.ec2.ISecurityGroup.class)));
}
/**
* Constructor that initializes the object based on literal property values passed by the {@link Builder}.
*/
@SuppressWarnings("unchecked")
protected Jsii$Proxy(final Builder builder) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
this.clusterEndpointAddress = java.util.Objects.requireNonNull(builder.clusterEndpointAddress, "clusterEndpointAddress is required");
this.clusterEndpointPort = java.util.Objects.requireNonNull(builder.clusterEndpointPort, "clusterEndpointPort is required");
this.clusterName = java.util.Objects.requireNonNull(builder.clusterName, "clusterName is required");
this.securityGroups = (java.util.List)builder.securityGroups;
}
@Override
public final java.lang.String getClusterEndpointAddress() {
return this.clusterEndpointAddress;
}
@Override
public final java.lang.Number getClusterEndpointPort() {
return this.clusterEndpointPort;
}
@Override
public final java.lang.String getClusterName() {
return this.clusterName;
}
@Override
public final java.util.List getSecurityGroups() {
return this.securityGroups;
}
@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("clusterEndpointAddress", om.valueToTree(this.getClusterEndpointAddress()));
data.set("clusterEndpointPort", om.valueToTree(this.getClusterEndpointPort()));
data.set("clusterName", om.valueToTree(this.getClusterName()));
if (this.getSecurityGroups() != null) {
data.set("securityGroups", om.valueToTree(this.getSecurityGroups()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("@aws-cdk/aws-redshift-alpha.ClusterAttributes"));
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;
ClusterAttributes.Jsii$Proxy that = (ClusterAttributes.Jsii$Proxy) o;
if (!clusterEndpointAddress.equals(that.clusterEndpointAddress)) return false;
if (!clusterEndpointPort.equals(that.clusterEndpointPort)) return false;
if (!clusterName.equals(that.clusterName)) return false;
return this.securityGroups != null ? this.securityGroups.equals(that.securityGroups) : that.securityGroups == null;
}
@Override
public final int hashCode() {
int result = this.clusterEndpointAddress.hashCode();
result = 31 * result + (this.clusterEndpointPort.hashCode());
result = 31 * result + (this.clusterName.hashCode());
result = 31 * result + (this.securityGroups != null ? this.securityGroups.hashCode() : 0);
return result;
}
}
}