toPort

@JvmStatic
@JvmName(name = "get")
fun Int.toPort(): Port(source)

Wraps the integer in the Port class.

If the value is within Ephemeral.MIN and Ephemeral.MAX, then Ephemeral is always returned.

Throws

IllegalArgumentException

if not within MIN and MAX (inclusive).


@JvmStatic
@JvmName(name = "get")
fun String.toPort(): Port(source)

Parses a String for a port between MIN and MAX (inclusive).

String can be either a URL containing the port, or the port string itself.

If the value is within Ephemeral.MIN and Ephemeral.MAX, then Ephemeral is always returned.

Throws

IllegalArgumentException

if no port is found.