- java.lang.Object
-
- org.refcodes.web.UrlImpl
-
- All Implemented Interfaces:
org.refcodes.mixin.CredentialsAccessor,org.refcodes.mixin.Dumpable,org.refcodes.mixin.IdentityAccessor,org.refcodes.mixin.PathAccessor,org.refcodes.mixin.PortAccessor,org.refcodes.mixin.SecretAccessor,FragmentAccessor,HostAccessor,IpAddressAccessor,QueryFieldsAccessor,SchemeAccessor,Url
public class UrlImpl extends Object implements Url
-
-
Nested Class Summary
-
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
-
Nested classes/interfaces inherited from interface org.refcodes.mixin.SecretAccessor
org.refcodes.mixin.SecretAccessor.SecretBuilder<B extends org.refcodes.mixin.SecretAccessor.SecretBuilder<B>>, org.refcodes.mixin.SecretAccessor.SecretMutator, org.refcodes.mixin.SecretAccessor.SecretProperty
-
Nested classes/interfaces inherited from interface org.refcodes.web.Url
Url.UrlBuilder
-
-
Constructor Summary
Constructors Constructor Description UrlImpl()Default constructor.UrlImpl(String aUrl)UrlImpl(String aProtocol, String aHost)Constructs anUrlwith the common attributes.UrlImpl(String aProtocol, String aHost, int aPort)Constructs anUrlwith the common attributes.UrlImpl(String aProtocol, String aHost, int aPort, String aPath)Constructs anUrlwith the common attributes.UrlImpl(String aProtocol, String aHost, int aPort, String aPath, FormFields aQueryFields)Constructs anUrlwith the common attributes.UrlImpl(String aProtocol, String aHost, int aPort, String aPath, FormFields aQueryFields, String aFragment)Constructs anUrlwith the common attributes.UrlImpl(String aProtocol, String aHost, String aPath)Constructs anUrlwith the common attributes.UrlImpl(String aProtocol, String aHost, String aPath, FormFields aQueryFields)Constructs anUrlwith the common attributes.UrlImpl(String aProtocol, String aHost, String aPath, FormFields aQueryFields, String aFragment)Constructs anUrlwith the common attributes.UrlImpl(String aUrl, FormFields aQueryFields)UrlImpl(String aUrl, FormFields aQueryFields, String aFragment)UrlImpl(URL aURL)UrlImpl(org.refcodes.data.Scheme aScheme, String aHost)Constructs anUrlwith the common attributes.UrlImpl(org.refcodes.data.Scheme aScheme, String aHost, int aPort)Constructs anUrlwith the common attributes.UrlImpl(org.refcodes.data.Scheme aScheme, String aHost, int aPort, String aPath)Constructs anUrlwith the common attributes.UrlImpl(org.refcodes.data.Scheme aScheme, String aHost, int aPort, String aPath, FormFields aQueryFields)Constructs anUrlwith the common attributes.UrlImpl(org.refcodes.data.Scheme aScheme, String aHost, int aPort, String aPath, FormFields aQueryFields, String aFragment)Constructs anUrlwith the common attributes.UrlImpl(org.refcodes.data.Scheme aScheme, String aHost, String aPath)Constructs anUrlwith the common attributes.UrlImpl(org.refcodes.data.Scheme aScheme, String aHost, String aPath, FormFields aQueryFields)Constructs anUrlwith the common attributes.UrlImpl(org.refcodes.data.Scheme aScheme, String aHost, String aPath, FormFields aQueryFields, String aFragment)Constructs anUrlwith the common attributes.UrlImpl(Url aUrl)UrlImpl(Url aUrl, String... aPaths)UrlImpl(Url aUrl, Url aOtherUrl)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetFragment()Retrieves the fragment from the fragment property.StringgetHost()Retrieves the host from the host property.StringgetIdentity()int[]getIpAddress()Retrieves the IP-Address from the IP-Address property.StringgetPath()intgetPort()FormFieldsgetQueryFields()Retrieves the request Query-Fields from the request Query-Fields property.org.refcodes.data.SchemegetScheme()Retrieves the UrlScheme from the URL scheme.StringgetSecret()StringtoProtocol()Retrieves the protocol representation from theScheme.StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.refcodes.web.IpAddressAccessor
toCidrNotation
-
-
-
-
Constructor Detail
-
UrlImpl
public UrlImpl()
Default constructor. Make sure to set required attributes for a valid URL.
-
UrlImpl
public UrlImpl(String aUrl) throws MalformedURLException
- Parameters:
aUrl- The URLStringto be parsed. The URL consists of the scheme (protocol), the identify and the secret (optional), the host as well as an optional port and the (optional) path.- Throws:
MalformedURLException- in case the provided URL is considered being malformed.
-
UrlImpl
public UrlImpl(String aUrl, FormFields aQueryFields) throws MalformedURLException
- Parameters:
aUrl- The URLStringto be parsed. The URL consists of the scheme (protocol), the identify and the secret (optional), the host as well as an optional port and the (optional) path.aQueryFields- The Query-Fields to be used for the HTTP Query-String.- Throws:
MalformedURLException- in case the provided URL is considered being malformed.
-
UrlImpl
public UrlImpl(String aUrl, FormFields aQueryFields, String aFragment) throws MalformedURLException
- Parameters:
aUrl- The URLStringto be parsed. The URL consists of the scheme (protocol), the identify and the secret (optional), the host as well as an optional port and the (optional) path.aQueryFields- The Query-Fields to be used for the HTTP Query-String.aFragment- The fragment to be set.- Throws:
MalformedURLException- in case the provided URL is considered being malformed.
-
UrlImpl
public UrlImpl(org.refcodes.data.Scheme aScheme, String aHost)Constructs anUrlwith the common attributes.- Parameters:
aScheme- TheScheme(e.g. HTTP or HTTPS) to be used for the destination URL.aHost- The host to which the destination URL is to point to.
-
UrlImpl
public UrlImpl(org.refcodes.data.Scheme aScheme, String aHost, int aPort)Constructs anUrlwith the common attributes.- Parameters:
aScheme- TheScheme(e.g. HTTP or HTTPS) to be used for the destination URL.aHost- The host to which the destination URL is to point to.aPort- The port to be used when connecting to the host.
-
UrlImpl
public UrlImpl(org.refcodes.data.Scheme aScheme, String aHost, int aPort, String aPath)Constructs anUrlwith the common attributes.- Parameters:
aScheme- TheScheme(e.g. HTTP or HTTPS) to be used for the destination URL.aHost- The host to which the destination URL is to point to.aPort- The port to be used when connecting to the host.aPath- The path on the host to which the base destination URL is to point to.
-
UrlImpl
public UrlImpl(org.refcodes.data.Scheme aScheme, String aHost, int aPort, String aPath, FormFields aQueryFields)Constructs anUrlwith the common attributes.- Parameters:
aScheme- TheScheme(e.g. HTTP or HTTPS) to be used for the destination URL.aHost- The host to which the destination URL is to point to.aPort- The port to be used when connecting to the host.aPath- The path on the host to which the base destination URL is to point to.aQueryFields- The Query-Fields to be used for the HTTP Query-String.
-
UrlImpl
public UrlImpl(org.refcodes.data.Scheme aScheme, String aHost, int aPort, String aPath, FormFields aQueryFields, String aFragment)Constructs anUrlwith the common attributes.- Parameters:
aScheme- TheScheme(e.g. HTTP or HTTPS) to be used for the destination URL.aHost- The host to which the destination URL is to point to.aPort- The port to be used when connecting to the host.aPath- The path on the host to which the base destination URL is to point to.aFragment- The fragment to be set.aQueryFields- The Query-Fields to be used for the HTTP Query-String.
-
UrlImpl
public UrlImpl(String aProtocol, String aHost)
Constructs anUrlwith the common attributes.- Parameters:
aProtocol- The protocolString(e.g. "http://" or "https://") to be used for the destination URL.aHost- The host to which the destination URL is to point to.
-
UrlImpl
public UrlImpl(String aProtocol, String aHost, int aPort)
Constructs anUrlwith the common attributes.- Parameters:
aProtocol- The protocolString(e.g. "http://" or "https://") to be used for the destination URL.aHost- The host to which the destination URL is to point to.aPort- The port to be used when connecting to the host.
-
UrlImpl
public UrlImpl(String aProtocol, String aHost, int aPort, String aPath)
Constructs anUrlwith the common attributes.- Parameters:
aProtocol- The protocolString(e.g. "http://" or "https://") to be used for the destination URL.aHost- The host to which the destination URL is to point to.aPort- The port to be used when connecting to the host.aPath- The path on the host to which the base destination URL is to point to.
-
UrlImpl
public UrlImpl(String aProtocol, String aHost, int aPort, String aPath, FormFields aQueryFields)
Constructs anUrlwith the common attributes.- Parameters:
aProtocol- The protocolString(e.g. "http://" or "https://") to be used for the destination URL.aHost- The host to which the destination URL is to point to.aPort- The port to be used when connecting to the host.aPath- The path on the host to which the base destination URL is to point to.aQueryFields- The Query-Fields to be used for the HTTP Query-String.
-
UrlImpl
public UrlImpl(String aProtocol, String aHost, int aPort, String aPath, FormFields aQueryFields, String aFragment)
Constructs anUrlwith the common attributes.- Parameters:
aProtocol- The protocolString(e.g. "http://" or "https://") to be used for the destination URL.aHost- The host to which the destination URL is to point to.aPort- The port to be used when connecting to the host.aPath- The path on the host to which the base destination URL is to point to.aFragment- The fragment to be set.aQueryFields- The Query-Fields to be used for the HTTP Query-String.
-
UrlImpl
public UrlImpl(org.refcodes.data.Scheme aScheme, String aHost, String aPath)Constructs anUrlwith the common attributes.- Parameters:
aScheme- TheScheme(e.g. HTTP or HTTPS) to be used for the destination URL.aHost- The host to which the destination URL is to point to.aPath- The path on the host to which the base destination URL is to point to.
-
UrlImpl
public UrlImpl(org.refcodes.data.Scheme aScheme, String aHost, String aPath, FormFields aQueryFields)Constructs anUrlwith the common attributes.- Parameters:
aScheme- TheScheme(e.g. HTTP or HTTPS) to be used for the destination URL.aHost- The host to which the destination URL is to point to.aPath- The path on the host to which the base destination URL is to point to.aQueryFields- The Query-Fields to be used for the HTTP Query-String.
-
UrlImpl
public UrlImpl(org.refcodes.data.Scheme aScheme, String aHost, String aPath, FormFields aQueryFields, String aFragment)Constructs anUrlwith the common attributes.- Parameters:
aScheme- TheScheme(e.g. HTTP or HTTPS) to be used for the destination URL.aHost- The host to which the destination URL is to point to.aPath- The path on the host to which the base destination URL is to point to.aQueryFields- The Query-Fields to be used for the HTTP Query-String.aFragment- The fragment to be set.
-
UrlImpl
public UrlImpl(String aProtocol, String aHost, String aPath)
Constructs anUrlwith the common attributes.- Parameters:
aProtocol- The protocolString(e.g. "http://" or "https://") to be used for the destination URL.aHost- The host to which the destination URL is to point to.aPath- The path on the host to which the base destination URL is to point to.
-
UrlImpl
public UrlImpl(String aProtocol, String aHost, String aPath, FormFields aQueryFields)
Constructs anUrlwith the common attributes.- Parameters:
aProtocol- The protocolString(e.g. "http://" or "https://") to be used for the destination URL.aHost- The host to which the destination URL is to point to.aPath- The path on the host to which the base destination URL is to point to.aQueryFields- The Query-Fields to be used for the HTTP Query-String.
-
UrlImpl
public UrlImpl(String aProtocol, String aHost, String aPath, FormFields aQueryFields, String aFragment)
Constructs anUrlwith the common attributes.- Parameters:
aProtocol- The protocolString(e.g. "http://" or "https://") to be used for the destination URL.aHost- The host to which the destination URL is to point to.aPath- The path on the host to which the base destination URL is to point to.aQueryFields- The Query-Fields to be used for the HTTP Query-String.aFragment- The fragment to be set.
-
-
Method Detail
-
getScheme
public org.refcodes.data.Scheme getScheme()
Retrieves the UrlScheme from the URL scheme.- Specified by:
getSchemein interfaceSchemeAccessor- Returns:
- The UrlScheme stored by the URL scheme.
-
toProtocol
public String toProtocol()
Retrieves the protocol representation from theScheme. In case of a scheme unknown by theSchemeenumeration, thenSchemeAccessor.getScheme()might return null whilstSchemeAccessor.toProtocol()still retrieves the unknown scheme's protocol representation (as ofSchemeAccessor.SchemeMutator.setProtocol(String)).- Specified by:
toProtocolin interfaceSchemeAccessor- Returns:
- The protocol representation for the URL.
-
getHost
public String getHost()
Retrieves the host from the host property.- Specified by:
getHostin interfaceHostAccessor- Returns:
- The host stored by the host property.
-
getIpAddress
public int[] getIpAddress()
Retrieves the IP-Address from the IP-Address property.- Specified by:
getIpAddressin interfaceIpAddressAccessor- Returns:
- The IP-Address stored by the IP-Address property.
-
getPort
public int getPort()
- Specified by:
getPortin interfaceorg.refcodes.mixin.PortAccessor
-
getPath
public String getPath()
- Specified by:
getPathin interfaceorg.refcodes.mixin.PathAccessor
-
getQueryFields
public FormFields getQueryFields()
Retrieves the request Query-Fields from the request Query-Fields property.- Specified by:
getQueryFieldsin interfaceQueryFieldsAccessor- Returns:
- The request Query-Fields stored by the request Query-Fields property.
-
getFragment
public String getFragment()
Retrieves the fragment from the fragment property.- Specified by:
getFragmentin interfaceFragmentAccessor- Returns:
- The fragment stored by the fragment property.
-
getIdentity
public String getIdentity()
- Specified by:
getIdentityin interfaceorg.refcodes.mixin.IdentityAccessor
-
getSecret
public String getSecret()
- Specified by:
getSecretin interfaceorg.refcodes.mixin.SecretAccessor
-
-