Package com.mastfrog.url
Class Port
java.lang.Object
com.mastfrog.url.Port
- All Implemented Interfaces:
URLComponent,Serializable
A TCP port. Represents the optional port portion of a URL, such as
https://www.timboudreau.com:8443/management/- Author:
- Tim Boudreau
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAppend this component to a StringBuilder.booleanGet a human-readable, localized name for this part of the URL.inthashCode()intintValue()Get the integer value of this portbooleanisValid()Determine if this is a valid port according to specification (i.e.toString()
-
Constructor Details
-
Port
public Port(int port) -
Port
-
-
Method Details
-
intValue
public int intValue()Get the integer value of this port- Returns:
-
toString
-
isValid
public boolean isValid()Determine if this is a valid port according to specification (i.e. port is non-negative and value is between 1 and 65535).- Specified by:
isValidin interfaceURLComponent- Returns:
-
getComponentName
Description copied from interface:URLComponentGet a human-readable, localized name for this part of the URL. Useful if an error message needs to be shown.- Specified by:
getComponentNamein interfaceURLComponent- Returns:
- The component name
-
appendTo
Description copied from interface:URLComponentAppend this component to a StringBuilder.- Specified by:
appendToin interfaceURLComponent- Parameters:
sb- A StringBuilder
-
equals
-
hashCode
public int hashCode()
-