public final class ForceServerListenPortImposition extends Object implements Imposition
This imposition is used by ServerConfigBuilder
.
If present, the imposed value will be used regardless of any previously specified setting on the builder.
ServerConfigBuilder.port(int)
,
Impositions
Modifier and Type | Method and Description |
---|---|
static ForceServerListenPortImposition |
ephemeral()
Creates an imposition that forces the use of an ephemeral port.
|
int |
getPort()
The port to be forced.
|
static ForceServerListenPortImposition |
of(int port)
Creates an imposition that forces the use of the specified port.
|
public static ForceServerListenPortImposition ephemeral()
public static ForceServerListenPortImposition of(int port)
port
- the port to forcepublic int getPort()