Package com.isode.dsapi.syntax
Class URIData
java.lang.Object
com.isode.dsapi.syntax.URIData
- All Implemented Interfaces:
Comparable<URIData>
This class stores information about a network address in the URI format.
This is an immutable class.
Examples:
http://127.0.0.1
itot://[FFEF::1]:19000
ldap://mv@127.0.0.1
ldaps://localhost:19000/
- Since:
- 15.0
- Author:
- mv
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor to create an object which is a copy of the given object but replaces the host name with the given host name.Creates a copy of the given URIData, but which replaces the hostName and portNo with the given values.Constructor to create an object with the given data.Constructor to create an object with the given data. -
Method Summary
-
Constructor Details
-
URIData
Constructor to create an object with the given data.- Parameters:
host
- Host name.port
- Port.scheme
- Scheme.- Throws:
BadValueException
- if any of the input is invalid.
-
URIData
Constructor to create an object with the given data.- Parameters:
str
- String representation of a URI data.- Throws:
BadValueException
- if the input is invalid.
-
URIData
Constructor to create an object which is a copy of the given object but replaces the host name with the given host name.- Parameters:
uriDataToCopy
- object to copy, must not be nullhostName
- Host name, must not be null- Throws:
BadValueException
- if any of the input is invalid.
-
URIData
Creates a copy of the given URIData, but which replaces the hostName and portNo with the given values.- Parameters:
uriDataToCopy
- The URIData to copy.hostName
- The new host name, must not benull
.portNo
- The new port no.- Throws:
BadValueException
- If any of the input is invalid.- Since:
- 16.0
-
-
Method Details
-
toString
-
getHost
Returns the host name of the URI data object.- Returns:
- Host name of the URI data, will never be null
-
getPort
public int getPort()Returns the port of the URI data object.- Returns:
- Port of the URI data.
-
getScheme
Returns the scheme of the URI data object.- Returns:
- Scheme of the URI data.
-
getCanonicalForm
The scheme is converted to lower case. The URI class does not have a method to return the canonical form, so uri is kept as it is.- Returns:
- canonical form of object.
-
equals
-
hashCode
public int hashCode() -
compareTo
- Specified by:
compareTo
in interfaceComparable<URIData>
-