software.amazon.awscdk.services.ec2.alpha.RouteTargetProps Maven / Gradle / Ivy
Show all versions of ec2-alpha Show documentation
package software.amazon.awscdk.services.ec2.alpha;
/**
* (experimental) The type of endpoint or gateway being targeted by the route.
*
* 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.ec2.alpha.*;
* import software.amazon.awscdk.services.ec2.*;
* IRouteTarget routeTarget;
* VpcEndpoint vpcEndpoint;
* RouteTargetProps routeTargetProps = RouteTargetProps.builder()
* .endpoint(vpcEndpoint)
* .gateway(routeTarget)
* .build();
*
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.102.0 (build e354887)", date = "2024-09-10T01:10:18.086Z")
@software.amazon.jsii.Jsii(module = software.amazon.awscdk.services.ec2.alpha.$Module.class, fqn = "@aws-cdk/aws-ec2-alpha.RouteTargetProps")
@software.amazon.jsii.Jsii.Proxy(RouteTargetProps.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public interface RouteTargetProps extends software.amazon.jsii.JsiiSerializable {
/**
* (experimental) The endpoint route target.
*
* This is used for targets such as
* VPC endpoints.
*
* Default: none
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.ec2.IVpcEndpoint getEndpoint() {
return null;
}
/**
* (experimental) The gateway route target.
*
* This is used for targets such as
* egress-only internet gateway or VPC peering connection.
*
* Default: none
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.ec2.alpha.IRouteTarget getGateway() {
return null;
}
/**
* @return a {@link Builder} of {@link RouteTargetProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link RouteTargetProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
software.amazon.awscdk.services.ec2.IVpcEndpoint endpoint;
software.amazon.awscdk.services.ec2.alpha.IRouteTarget gateway;
/**
* Sets the value of {@link RouteTargetProps#getEndpoint}
* @param endpoint The endpoint route target.
* This is used for targets such as
* VPC endpoints.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder endpoint(software.amazon.awscdk.services.ec2.IVpcEndpoint endpoint) {
this.endpoint = endpoint;
return this;
}
/**
* Sets the value of {@link RouteTargetProps#getGateway}
* @param gateway The gateway route target.
* This is used for targets such as
* egress-only internet gateway or VPC peering connection.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder gateway(software.amazon.awscdk.services.ec2.alpha.IRouteTarget gateway) {
this.gateway = gateway;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link RouteTargetProps}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public RouteTargetProps build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link RouteTargetProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements RouteTargetProps {
private final software.amazon.awscdk.services.ec2.IVpcEndpoint endpoint;
private final software.amazon.awscdk.services.ec2.alpha.IRouteTarget gateway;
/**
* 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.endpoint = software.amazon.jsii.Kernel.get(this, "endpoint", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.ec2.IVpcEndpoint.class));
this.gateway = software.amazon.jsii.Kernel.get(this, "gateway", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.ec2.alpha.IRouteTarget.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.endpoint = builder.endpoint;
this.gateway = builder.gateway;
}
@Override
public final software.amazon.awscdk.services.ec2.IVpcEndpoint getEndpoint() {
return this.endpoint;
}
@Override
public final software.amazon.awscdk.services.ec2.alpha.IRouteTarget getGateway() {
return this.gateway;
}
@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.getEndpoint() != null) {
data.set("endpoint", om.valueToTree(this.getEndpoint()));
}
if (this.getGateway() != null) {
data.set("gateway", om.valueToTree(this.getGateway()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("@aws-cdk/aws-ec2-alpha.RouteTargetProps"));
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;
RouteTargetProps.Jsii$Proxy that = (RouteTargetProps.Jsii$Proxy) o;
if (this.endpoint != null ? !this.endpoint.equals(that.endpoint) : that.endpoint != null) return false;
return this.gateway != null ? this.gateway.equals(that.gateway) : that.gateway == null;
}
@Override
public final int hashCode() {
int result = this.endpoint != null ? this.endpoint.hashCode() : 0;
result = 31 * result + (this.gateway != null ? this.gateway.hashCode() : 0);
return result;
}
}
}