Package com.atlassian.jira.util
Class PortUtil
java.lang.Object
com.atlassian.jira.util.PortUtil
Class that validates the value of a TCP/UDP port.
- Since:
- v4.0
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisValidPort(int port) Tells the caller of the passed int represents a valid TCP/UDP port.static booleanisValidPort(String port) Tells the caller of the passed string represents a valid TCP/UDP port.static intReturn the TCP/UDP port contained in the passed port string.
-
Field Details
-
MIN_PORT
public static final int MIN_PORT- See Also:
-
MAX_PORT
public static final int MAX_PORT- See Also:
-
-
Method Details
-
parsePort
Return the TCP/UDP port contained in the passed port string. Returns -1 if the passed string is not a valid port.- Parameters:
port- the string to get the port from.- Returns:
- a valid port if the string contains a valid port, or -1 otherwise.
-
isValidPort
Tells the caller of the passed string represents a valid TCP/UDP port.- Parameters:
port- the string to check.- Returns:
- true if the passed string is a valid port or false otherwise.
-
isValidPort
public static boolean isValidPort(int port) Tells the caller of the passed int represents a valid TCP/UDP port.- Parameters:
port- the int to check.- Returns:
- true if the passed string is a valid port or false otherwise.
-