-
- All Superinterfaces:
org.refcodes.mixin.CredentialsAccessor,org.refcodes.mixin.Dumpable,FragmentAccessor,HostAccessor,org.refcodes.mixin.IdentityAccessor,IpAddressAccessor,org.refcodes.mixin.PathAccessor,org.refcodes.mixin.PortAccessor,QueryFieldsAccessor,SchemeAccessor,org.refcodes.mixin.SecretAccessor
- All Known Subinterfaces:
Url.UrlBuilder
- All Known Implementing Classes:
UrlBuilderImpl,UrlImpl
public interface Url extends org.refcodes.mixin.Dumpable, SchemeAccessor, HostAccessor, IpAddressAccessor, org.refcodes.mixin.PortAccessor, org.refcodes.mixin.PathAccessor, QueryFieldsAccessor, FragmentAccessor, org.refcodes.mixin.CredentialsAccessor
An URL looks something like this: "scheme://[identity[:secret]@]host[:port][/path][?query][#fragment] In contrast to thejava.netURL, this URL also supports "relative" locators with neither a scheme nor a host declaration. If the relative locator starts with a "/" slash, then we assume not having a host being provided: "/path?query#fragment" When it does *not* start with a "/" slash, then we assume that the first element being the host: "[identity[:secret]@]host[:port]/path[?query][#fragment]"
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceUrl.UrlBuilder-
Nested classes/interfaces inherited from interface org.refcodes.mixin.CredentialsAccessor
org.refcodes.mixin.CredentialsAccessor.CredentialsBuilder<B extends org.refcodes.mixin.CredentialsAccessor.CredentialsBuilder<B>>, org.refcodes.mixin.CredentialsAccessor.CredentialsMutator, org.refcodes.mixin.CredentialsAccessor.CredentialsProperty
-
Nested classes/interfaces inherited from interface org.refcodes.web.FragmentAccessor
FragmentAccessor.FragmentBuilder<B extends FragmentAccessor.FragmentBuilder<?>>, FragmentAccessor.FragmentMutator, FragmentAccessor.FragmentProperty
-
Nested classes/interfaces inherited from interface org.refcodes.web.HostAccessor
HostAccessor.HostBuilder<B extends HostAccessor.HostBuilder<?>>, HostAccessor.HostMutator, HostAccessor.HostProperty
-
Nested classes/interfaces inherited from interface org.refcodes.mixin.IdentityAccessor
org.refcodes.mixin.IdentityAccessor.IdentityBuilder<B extends org.refcodes.mixin.IdentityAccessor.IdentityBuilder<B>>, org.refcodes.mixin.IdentityAccessor.IdentityMutator, org.refcodes.mixin.IdentityAccessor.IdentityProperty
-
Nested classes/interfaces inherited from interface org.refcodes.web.IpAddressAccessor
IpAddressAccessor.IpAddressBuilder<B extends IpAddressAccessor.IpAddressBuilder<B>>, IpAddressAccessor.IpAddressMutator, IpAddressAccessor.IpAddressProperty
-
Nested classes/interfaces inherited from interface org.refcodes.mixin.PathAccessor
org.refcodes.mixin.PathAccessor.PathBuilder<B extends org.refcodes.mixin.PathAccessor.PathBuilder<?>>, org.refcodes.mixin.PathAccessor.PathMutator, org.refcodes.mixin.PathAccessor.PathProperty
-
Nested classes/interfaces inherited from interface org.refcodes.mixin.PortAccessor
org.refcodes.mixin.PortAccessor.PortBuilder<B extends org.refcodes.mixin.PortAccessor.PortBuilder<B>>, org.refcodes.mixin.PortAccessor.PortMutator, org.refcodes.mixin.PortAccessor.PortProperty
-
Nested classes/interfaces inherited from interface org.refcodes.web.QueryFieldsAccessor
QueryFieldsAccessor.QueryFieldsBuilder<B extends QueryFieldsAccessor.QueryFieldsBuilder<?>>, QueryFieldsAccessor.QueryFieldsMutator, QueryFieldsAccessor.QueryFieldsProperty
-
Nested classes/interfaces inherited from interface org.refcodes.web.SchemeAccessor
SchemeAccessor.SchemeBuilder<B extends SchemeAccessor.SchemeBuilder<B>>, SchemeAccessor.SchemeMutator, SchemeAccessor.SchemeProperty
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default StringtoHost()Returns the "host" depending on whether an IP-Address has been provided or a host name.default StringtoHttpUrl()default StringtoLocator()Creates the locator part from theUrlinstance's state, excluding the fragment or the query fields.default URLtoURL()-
Methods inherited from interface org.refcodes.web.FragmentAccessor
getFragment
-
Methods inherited from interface org.refcodes.web.HostAccessor
getHost
-
Methods inherited from interface org.refcodes.web.IpAddressAccessor
getIpAddress, toCidrNotation
-
Methods inherited from interface org.refcodes.web.QueryFieldsAccessor
getQueryFields
-
Methods inherited from interface org.refcodes.web.SchemeAccessor
getScheme, toProtocol
-
-
-
-
Method Detail
-
toHost
default String toHost()
Returns the "host" depending on whether an IP-Address has been provided or a host name.- Returns:
- The determined host.
-
toLocator
default String toLocator()
Creates the locator part from theUrlinstance's state, excluding the fragment or the query fields.- Returns:
- The locator for the given
Url.
-
toURL
default URL toURL() throws MalformedURLException
- Returns:
- The according
URLinstance. - Throws:
MalformedURLException- thrown in case the state of yourUrlinstance cannot be used to construct a validURL, you may be missing some properties.
-
-