## Url class

Provides an object representation of a universal identifier (URL).

```java
public class Url : DOMObject
```

## Constructors

| Name | Description |
| --- | --- |
| [Url](url/#constructor)(String) | Initializes a new instance of the `Url` with the specified URL. |
| [Url](url/#constructor_1)(String, String) | Initializes a new instance of the `Url` with the specified URL and base URL. |

## Properties

| Name | Description |
| --- | --- |
[getHash]
[setHash] Gets or sets a String representation for the specified URL hash segment. |
[getHost]
[setHost] Gets or sets a String representation for the specified URL host. |
[getHostname]
[setHostname] Gets or sets a String representation for the specified URL hostname. |
[getHref]
[setHref] Gets or sets a serialized representation for the specified URL instance. |
| [getOrigin](../../com.aspose.html/url/origin/) Gets a String representation for the specified URL origin. |
[getPassword]
[setPassword] Gets or sets a String representation for the specified URL password. |
[getPathname]
[setPathname] Gets or sets a String representation for the specified URL path. |
[getPort]
[setPort] Gets or sets a String representation for the specified URL port. |
[getProtocol]
[setProtocol] Gets or sets a String representation for the specified URL schema. |
[getSearch]
[setSearch] Gets or sets a String representation for the specified URL search segment. |
| [getSearchParams](../../com.aspose.html/url/searchparams/) Gets an associated [`IUrlSearchParams`](../iurlsearchparams/) object. |
[getUsername]
[setUsername] Gets or sets a String representation for the specified URL username. |

## Methods

| Name | Description |
| --- | --- |
| [equals](../../com.aspose.html/url/equals/)(object) | Determines whether the specified Object, is equal to this instance. |
| [getHashCode](../../com.aspose.html/url/gethashcode/)() | Returns a hash code for this instance. |
| [getPlatformType](../../com.aspose.html.dom/domobject/getplatformtype/)() | This method is used to retrieve the ECMAScript object . |
| [toJson](../../com.aspose.html/url/tojson/)() | Returns a String that represents this instance. |
| [toString](../../com.aspose.html/url/toString/)() | Returns a String that represents this instance. |

### See Also

* class [DOMObject](../../com.aspose.html.dom/domobject/)
* package [com.aspose.html](../../com.aspose.html/)
* package [Aspose.HTML](../../)
