public class Port extends Object
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object other) |
int |
getPort()
Gets the port number.
|
String |
getProtocol()
Gets the protocol.
|
int |
hashCode() |
static Port |
parseProtocol(int port,
String protocolString)
Gets a
Port with protocol parsed from the string form protocolString. |
static Port |
tcp(int port)
Create a new
Port with TCP protocol. |
String |
toString()
Stringifies the port with protocol, in the form
<port>/<protocol>. |
static Port |
udp(int port)
Create a new
Port with UDP protocol. |
public static Port tcp(int port)
Port with TCP protocol.port - the port numberPortpublic static Port udp(int port)
Port with UDP protocol.port - the port numberPortpublic static Port parseProtocol(int port, String protocolString)
Port with protocol parsed from the string form protocolString. Unknown
protocols will default to TCP.port - the port numberprotocolString - the case insensitive string (e.g. "tcp", "udp")Portpublic int getPort()
public String getProtocol()
Copyright © 2019. All rights reserved.