public class EndpointUtil extends Object
| Constructor and Description |
|---|
EndpointUtil() |
| Modifier and Type | Method and Description |
|---|---|
static @Nullable String |
getHost(@NotNull String endpointUrl) |
static @NotNull String |
getPath(@NotNull String endpointUrl)
Get the path component from an endpoint URL.
|
static int |
getPort(@NotNull String endpointUrl) |
static @Nullable String |
getScheme(@NotNull String endpointUrl) |
static EndpointDescription |
updateUrl(@NotNull EndpointDescription endpoint,
@Nullable String hostname)
Replace the hostname in the endpoint URL field of
endpoint with a new one. |
static EndpointDescription |
updateUrl(@NotNull EndpointDescription endpoint,
@Nullable String hostname,
int port)
Replace the hostname and port in the endpoint URL field of
endpoint with new ones. |
public static int getPort(@NotNull
@NotNull String endpointUrl)
@NotNull public static @NotNull String getPath(@NotNull @NotNull String endpointUrl)
An empty path becomes "/" and trailing "/" are removed from non-empty paths.
endpointUrl - the endpoint URL.public static EndpointDescription updateUrl(@NotNull @NotNull EndpointDescription endpoint, @Nullable @Nullable String hostname)
endpoint with a new one.
All other fields of the original EndpointDescription remain equal.
If the endpoint URL does not match the expected format the original endpoint is returned.
endpoint - the EndpointDescription to modify.hostname - the new hostname to use. A null value will result in the original hostname being used.EndpointDescription in which the hostname of the endpoint URL has been replaced with
hostname.public static EndpointDescription updateUrl(@NotNull @NotNull EndpointDescription endpoint, @Nullable @Nullable String hostname, int port)
endpoint with new ones.
All other fields of the original EndpointDescription remain equal.
If the endpoint URL does not match the expected format the original endpoint is returned.
endpoint - the EndpointDescription to modify.hostname - the new hostname to use. A null value will result in the original hostname being used.port - the new port to use. Any value <= 0 will result in the original port being used.EndpointDescription in which the hostname of the endpoint URL has been replaced with
hostname.Copyright © 2025. All rights reserved.