@Generated(value="jsii-pacmak/1.73.0 (build 6faeda3)",
date="2023-01-31T18:36:55.541Z")
public class Endpoint
extends software.amazon.jsii.JsiiObject
Consists of a combination of hostname and port.
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.docdb.*; Endpoint endpoint = new Endpoint("address", 123);
Modifier | Constructor and Description |
---|---|
protected |
Endpoint(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
Endpoint(software.amazon.jsii.JsiiObjectRef objRef) |
|
Endpoint(java.lang.String address,
java.lang.Number port)
Constructs an Endpoint instance.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getHostname()
The hostname of the endpoint.
|
java.lang.Number |
getPort()
The port number of the endpoint.
|
java.lang.String |
getSocketAddress()
The combination of ``HOSTNAME:PORT`` for this endpoint.
|
java.lang.String |
portAsString()
Returns the port number as a string representation that can be used for embedding within other strings.
|
protected Endpoint(software.amazon.jsii.JsiiObjectRef objRef)
protected Endpoint(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public Endpoint(java.lang.String address, java.lang.Number port)
address
- - The hostname or address of the endpoint. This parameter is required.port
- - The port number of the endpoint. This parameter is required.public java.lang.String portAsString()
This is intended to deal with CDK's token system. Numeric CDK tokens are not expanded when their string representation is embedded in a string. This function returns the port either as an unresolved string token or as a resolved string representation of the port value.
public java.lang.String getHostname()
public java.lang.Number getPort()
This can potentially be a CDK token. If you need to embed the port in a string (e.g. instance user data script), use {@link Endpoint.portAsString}.
public java.lang.String getSocketAddress()