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 anUrl
with the common attributes.UrlImpl(String aProtocol, String aHost, int aPort)
Constructs anUrl
with the common attributes.UrlImpl(String aProtocol, String aHost, int aPort, String aPath)
Constructs anUrl
with the common attributes.UrlImpl(String aProtocol, String aHost, int aPort, String aPath, FormFields aQueryFields)
Constructs anUrl
with the common attributes.UrlImpl(String aProtocol, String aHost, int aPort, String aPath, FormFields aQueryFields, String aFragment)
Constructs anUrl
with the common attributes.UrlImpl(String aProtocol, String aHost, String aPath)
Constructs anUrl
with the common attributes.UrlImpl(String aProtocol, String aHost, String aPath, FormFields aQueryFields)
Constructs anUrl
with the common attributes.UrlImpl(String aProtocol, String aHost, String aPath, FormFields aQueryFields, String aFragment)
Constructs anUrl
with 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 anUrl
with the common attributes.UrlImpl(org.refcodes.data.Scheme aScheme, String aHost, int aPort)
Constructs anUrl
with the common attributes.UrlImpl(org.refcodes.data.Scheme aScheme, String aHost, int aPort, String aPath)
Constructs anUrl
with the common attributes.UrlImpl(org.refcodes.data.Scheme aScheme, String aHost, int aPort, String aPath, FormFields aQueryFields)
Constructs anUrl
with the common attributes.UrlImpl(org.refcodes.data.Scheme aScheme, String aHost, int aPort, String aPath, FormFields aQueryFields, String aFragment)
Constructs anUrl
with the common attributes.UrlImpl(org.refcodes.data.Scheme aScheme, String aHost, String aPath)
Constructs anUrl
with the common attributes.UrlImpl(org.refcodes.data.Scheme aScheme, String aHost, String aPath, FormFields aQueryFields)
Constructs anUrl
with the common attributes.UrlImpl(org.refcodes.data.Scheme aScheme, String aHost, String aPath, FormFields aQueryFields, String aFragment)
Constructs anUrl
with the common attributes.UrlImpl(Url aUrl)
UrlImpl(Url aUrl, String... aPaths)
UrlImpl(Url aUrl, Url aOtherUrl)
-
Method Summary
Modifier and Type Method Description String
getFragment()
Retrieves the fragment from the fragment property.String
getHost()
Retrieves the host from the host property.String
getIdentity()
int[]
getIpAddress()
Retrieves the IP-Address from the IP-Address property.String
getPath()
int
getPort()
FormFields
getQueryFields()
Retrieves the request Query-Fields from the request Query-Fields property.org.refcodes.data.Scheme
getScheme()
Retrieves the UrlScheme from the URL scheme.String
getSecret()
String
toProtocol()
Retrieves the protocol representation from theScheme
.String
toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.refcodes.mixin.Dumpable
toDump, toDump, toPrintable
Methods inherited from interface org.refcodes.web.IpAddressAccessor
toCidrNotation
-
Constructor Details
-
UrlImpl
public UrlImpl()Default constructor. Make sure to set required attributes for a valid URL. -
UrlImpl
- Parameters:
aUrl
- The URLString
to 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
- Parameters:
aUrl
- The URLString
to 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 URLString
to 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
- Parameters:
aURL
- TheURL
to be used.
-
UrlImpl
Constructs anUrl
with 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
Constructs anUrl
with 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
Constructs anUrl
with 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 anUrl
with 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 anUrl
with 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
Constructs anUrl
with 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
Constructs anUrl
with 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
Constructs anUrl
with 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
Constructs anUrl
with 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 anUrl
with 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
Constructs anUrl
with 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 anUrl
with 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 anUrl
with 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
Constructs anUrl
with 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
Constructs anUrl
with 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 anUrl
with 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.
-
UrlImpl
-
UrlImpl
-
UrlImpl
- Parameters:
aUrl
- TheUrl
from which to construct this instance.
-
-
Method Details
-
getScheme
public org.refcodes.data.Scheme getScheme()Retrieves the UrlScheme from the URL scheme.- Specified by:
getScheme
in interfaceSchemeAccessor
- Returns:
- The UrlScheme stored by the URL scheme.
-
toProtocol
Retrieves the protocol representation from theScheme
. In case of a scheme unknown by theScheme
enumeration, thenSchemeAccessor.getScheme()
might return null whilstSchemeAccessor.toProtocol()
still retrieves the unknown scheme's protocol representation (as ofSchemeAccessor.SchemeMutator.setProtocol(String)
).- Specified by:
toProtocol
in interfaceSchemeAccessor
- Returns:
- The protocol representation for the URL.
-
getHost
Retrieves the host from the host property.- Specified by:
getHost
in interfaceHostAccessor
- Returns:
- The host stored by the host property.
-
getIpAddress
public int[] getIpAddress()Retrieves the IP-Address from the IP-Address property.- Specified by:
getIpAddress
in interfaceIpAddressAccessor
- Returns:
- The IP-Address stored by the IP-Address property.
-
getPort
public int getPort()- Specified by:
getPort
in interfaceorg.refcodes.mixin.PortAccessor
-
getPath
- Specified by:
getPath
in interfaceorg.refcodes.mixin.PathAccessor
-
getQueryFields
Retrieves the request Query-Fields from the request Query-Fields property.- Specified by:
getQueryFields
in interfaceQueryFieldsAccessor
- Returns:
- The request Query-Fields stored by the request Query-Fields property.
-
getFragment
Retrieves the fragment from the fragment property.- Specified by:
getFragment
in interfaceFragmentAccessor
- Returns:
- The fragment stored by the fragment property.
-
getIdentity
- Specified by:
getIdentity
in interfaceorg.refcodes.mixin.IdentityAccessor
-
getSecret
- Specified by:
getSecret
in interfaceorg.refcodes.mixin.SecretAccessor
-
toString
-