Package io.smallrye.stork.utils
Class StorkAddressUtils
- java.lang.Object
-
- io.smallrye.stork.utils.StorkAddressUtils
-
public final class StorkAddressUtils extends Object
A set of utility methods around addresses.
-
-
Field Summary
Fields Modifier and Type Field Description static StringHTTP_PREFIXstatic StringHTTPS_PREFIX
-
Constructor Summary
Constructors Constructor Description StorkAddressUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static HostAndPortparseToHostAndPort(String address, int defaultPort, String configPlace)Creates a newHostAndPortinstance from an address.static StringparseToString(HostAndPort hostAndPort)
-
-
-
Field Detail
-
HTTP_PREFIX
public static final String HTTP_PREFIX
- See Also:
- Constant Field Values
-
HTTPS_PREFIX
public static final String HTTPS_PREFIX
- See Also:
- Constant Field Values
-
-
Method Detail
-
parseToHostAndPort
public static HostAndPort parseToHostAndPort(String address, int defaultPort, String configPlace)
Creates a newHostAndPortinstance from an address.- Parameters:
address- the address, eitherhost:portor justhostdefaultPort- the default port, used when the address doesn't provide the portconfigPlace- the location of the address in the configuration, for logging purposes- Returns:
- the new HostAndPort
-
parseToString
public static String parseToString(HostAndPort hostAndPort)
- Parameters:
hostAndPort-HostAndPortinstance from an address.- Returns:
- the String containing either
host:portor justhost
-
-