java.lang.Object
org.refcodes.web.Url
org.refcodes.web.UrlBuilder
- All Implemented Interfaces:
org.refcodes.mixin.CredentialsAccessor,org.refcodes.mixin.CredentialsAccessor.CredentialsBuilder<UrlBuilder>,org.refcodes.mixin.CredentialsAccessor.CredentialsMutator,org.refcodes.mixin.CredentialsAccessor.CredentialsProperty,org.refcodes.mixin.Dumpable,org.refcodes.mixin.IdentityAccessor,org.refcodes.mixin.IdentityAccessor.IdentityBuilder<UrlBuilder>,org.refcodes.mixin.IdentityAccessor.IdentityMutator,org.refcodes.mixin.IdentityAccessor.IdentityProperty,org.refcodes.mixin.PathAccessor,org.refcodes.mixin.PathAccessor.PathBuilder<UrlBuilder>,org.refcodes.mixin.PathAccessor.PathMutator,org.refcodes.mixin.PathAccessor.PathProperty,org.refcodes.mixin.PortAccessor,org.refcodes.mixin.PortAccessor.PortBuilder<UrlBuilder>,org.refcodes.mixin.PortAccessor.PortMutator,org.refcodes.mixin.PortAccessor.PortProperty,org.refcodes.mixin.SecretAccessor,org.refcodes.mixin.SecretAccessor.SecretBuilder<UrlBuilder>,org.refcodes.mixin.SecretAccessor.SecretMutator,org.refcodes.mixin.SecretAccessor.SecretProperty,org.refcodes.net.IpAddressAccessor,org.refcodes.net.IpAddressAccessor.IpAddressBuilder<UrlBuilder>,org.refcodes.net.IpAddressAccessor.IpAddressMutator,org.refcodes.net.IpAddressAccessor.IpAddressProperty,FragmentAccessor,FragmentAccessor.FragmentBuilder<UrlBuilder>,FragmentAccessor.FragmentMutator,FragmentAccessor.FragmentProperty,HostAccessor,HostAccessor.HostBuilder<UrlBuilder>,HostAccessor.HostMutator,HostAccessor.HostProperty,QueryFieldsAccessor,QueryFieldsAccessor.QueryFieldsBuilder<UrlBuilder>,QueryFieldsAccessor.QueryFieldsMutator,QueryFieldsAccessor.QueryFieldsProperty,SchemeAccessor,SchemeAccessor.SchemeBuilder<UrlBuilder>,SchemeAccessor.SchemeMutator,SchemeAccessor.SchemeProperty
public class UrlBuilder
extends Url
implements SchemeAccessor.SchemeProperty, SchemeAccessor.SchemeBuilder<UrlBuilder>, HostAccessor.HostProperty, HostAccessor.HostBuilder<UrlBuilder>, org.refcodes.net.IpAddressAccessor.IpAddressProperty, org.refcodes.net.IpAddressAccessor.IpAddressBuilder<UrlBuilder>, org.refcodes.mixin.PortAccessor.PortProperty, org.refcodes.mixin.PortAccessor.PortBuilder<UrlBuilder>, org.refcodes.mixin.PathAccessor.PathProperty, org.refcodes.mixin.PathAccessor.PathBuilder<UrlBuilder>, QueryFieldsAccessor.QueryFieldsProperty, QueryFieldsAccessor.QueryFieldsBuilder<UrlBuilder>, FragmentAccessor.FragmentProperty, FragmentAccessor.FragmentBuilder<UrlBuilder>, org.refcodes.mixin.CredentialsAccessor.CredentialsProperty, org.refcodes.mixin.CredentialsAccessor.CredentialsBuilder<UrlBuilder>
The
UrlBuilder extends an immutable Url with mutable
functionality.-
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.CredentialsPropertyNested classes/interfaces inherited from interface org.refcodes.web.FragmentAccessor
FragmentAccessor.FragmentBuilder<B extends FragmentAccessor.FragmentBuilder<?>>, FragmentAccessor.FragmentMutator, FragmentAccessor.FragmentPropertyNested classes/interfaces inherited from interface org.refcodes.web.HostAccessor
HostAccessor.HostBuilder<B extends HostAccessor.HostBuilder<?>>, HostAccessor.HostMutator, HostAccessor.HostPropertyNested 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.IdentityPropertyNested classes/interfaces inherited from interface org.refcodes.net.IpAddressAccessor
org.refcodes.net.IpAddressAccessor.IpAddressBuilder<B extends org.refcodes.net.IpAddressAccessor.IpAddressBuilder<B>>, org.refcodes.net.IpAddressAccessor.IpAddressMutator, org.refcodes.net.IpAddressAccessor.IpAddressPropertyNested 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.PathPropertyNested 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.PortPropertyNested classes/interfaces inherited from interface org.refcodes.web.QueryFieldsAccessor
QueryFieldsAccessor.QueryFieldsBuilder<B extends QueryFieldsAccessor.QueryFieldsBuilder<?>>, QueryFieldsAccessor.QueryFieldsMutator, QueryFieldsAccessor.QueryFieldsPropertyNested classes/interfaces inherited from interface org.refcodes.web.SchemeAccessor
SchemeAccessor.SchemeBuilder<B extends SchemeAccessor.SchemeBuilder<B>>, SchemeAccessor.SchemeMutator, SchemeAccessor.SchemePropertyNested 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 -
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionUrlBuilder(String aUrl) UrlBuilder(String aProtocol, String aHost) UrlBuilder(String aProtocol, String aHost, int aPort) UrlBuilder(String aProtocol, String aHost, int aPort, String aPath) UrlBuilder(String aProtocol, String aHost, int aPort, String aPath, FormFields aQueryFields) UrlBuilder(String aProtocol, String aHost, int aPort, String aPath, FormFields aQueryFields, String aFragment) UrlBuilder(String aProtocol, String aHost, String aPath) UrlBuilder(String aProtocol, String aHost, String aPath, FormFields aQueryFields) UrlBuilder(String aProtocol, String aHost, String aPath, FormFields aQueryFields, String aFragment) UrlBuilder(String aUrl, FormFields aQueryFields) UrlBuilder(String aUrl, FormFields aQueryFields, String aFragment) UrlBuilder(URL aURL) UrlBuilder(org.refcodes.data.Scheme aScheme, String aHost) UrlBuilder(org.refcodes.data.Scheme aScheme, String aHost, int aPort) UrlBuilder(org.refcodes.data.Scheme aScheme, String aHost, int aPort, String aPath) UrlBuilder(org.refcodes.data.Scheme aScheme, String aHost, int aPort, String aPath, FormFields aQueryFields) UrlBuilder(org.refcodes.data.Scheme aScheme, String aHost, int aPort, String aPath, FormFields aQueryFields, String aFragment) UrlBuilder(org.refcodes.data.Scheme aScheme, String aHost, String aPath) UrlBuilder(org.refcodes.data.Scheme aScheme, String aHost, String aPath, FormFields aQueryFields) UrlBuilder(org.refcodes.data.Scheme aScheme, String aHost, String aPath, FormFields aQueryFields, String aFragment) UrlBuilder(Url aUrl) UrlBuilder(Url aUrl, String... aPaths) UrlBuilder(Url aUrl, Url aOtherUrl) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddToQueryFields(String aField, String aValue) Adds a value to the list of values associated with the given Query-Field (key).voidaddToQueryFields(String aField, String... aValues) Adds values to the list of values associated with the given Query-Field (key).voidappendToPath(String aPathElement) Appends a path element to the path.voidappendToPath(String... aPathElements) Appends multiple path elements to the path, automatically adding the path separator "/" as required.voidvoidvoidsetFragment(String aFragment) Sets the fragment for the fragment property.voidSets the host for the host property.voidsetIdentity(String aIdentity) voidsetIpAddress(int[] aIpAddress) voidvoidsetPort(int aPort) voidsetProtocol(String aProtocol) Sets the protocolStringrepresentation for the scheme property.voidsetQueryFields(FormFields aQueryFields) Sets the request Query-Fields for the request Query-Fields property.voidsetScheme(org.refcodes.data.Scheme aScheme) Sets the UrlScheme for the URL scheme.voidtoString()withAddToQueryFields(String aField, String aValue) Adds a value to the list of values associated with the given Query-Field (key) and returns this builder as of the Builder-Pattern.withAddToQueryFields(String aField, String... aValues) Adds values to the list of values associated with the given Query-Field (key) and returns this builder as of the Builder-Pattern.withAppendToPath(String aPath) Appends a path element to the path as of the Builder-Pattern.withAppendToPath(String... aPathElements) Appends multiple path elements to the path, automatically adding the path separator "/" as required as of the Builder-Pattern.withCidrNotation(String aCidrNotation) withFragment(String aFragment) Sets the fragment to use and returns this builder as of the builder pattern.Sets the host to use and returns this builder as of the builder pattern.withIdentity(String aIdentity) withIpAddress(int[] aIpAddress) withPort(int aPort) withProtocol(String aProtocol) Sets the protocol for the URL scheme.withQueryFields(FormFields aQueryFields) Sets the request Query-Fields to use and returns this builder as of the Builder-Pattern.withScheme(org.refcodes.data.Scheme aScheme) Sets the UrlScheme for the URL scheme.withSecret(String aSecret) Methods inherited from class org.refcodes.web.Url
getFragment, getHost, getIdentity, getIpAddress, getPath, getPort, getQueryFields, getScheme, getSecret, toHost, toHttpUrl, toLocator, toProtocol, toTruncatePath, toTruncatePathPrefix, toTruncatePathSuffix, toURLMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.refcodes.mixin.Dumpable
toDump, toDumpMethods inherited from interface org.refcodes.web.FragmentAccessor
getFragmentMethods inherited from interface org.refcodes.web.FragmentAccessor.FragmentProperty
letFragmentMethods inherited from interface org.refcodes.web.HostAccessor
getHostMethods inherited from interface org.refcodes.web.HostAccessor.HostProperty
letHostMethods inherited from interface org.refcodes.mixin.IdentityAccessor
getIdentityMethods inherited from interface org.refcodes.mixin.IdentityAccessor.IdentityProperty
letIdentityMethods inherited from interface org.refcodes.net.IpAddressAccessor
getIpAddress, toCidrNotationMethods inherited from interface org.refcodes.net.IpAddressAccessor.IpAddressMutator
fromCidrNotationMethods inherited from interface org.refcodes.net.IpAddressAccessor.IpAddressProperty
letIpAddressMethods inherited from interface org.refcodes.mixin.PathAccessor
getPathMethods inherited from interface org.refcodes.mixin.PathAccessor.PathProperty
letPathMethods inherited from interface org.refcodes.mixin.PortAccessor
getPortMethods inherited from interface org.refcodes.mixin.PortAccessor.PortProperty
letPortMethods inherited from interface org.refcodes.web.QueryFieldsAccessor
getQueryFieldsMethods inherited from interface org.refcodes.web.QueryFieldsAccessor.QueryFieldsProperty
letQueryFieldsMethods inherited from interface org.refcodes.web.SchemeAccessor
getScheme, toProtocolMethods inherited from interface org.refcodes.web.SchemeAccessor.SchemeProperty
letProtocol, letSchemeMethods inherited from interface org.refcodes.mixin.SecretAccessor
getSecretMethods inherited from interface org.refcodes.mixin.SecretAccessor.SecretProperty
letSecret
-
Constructor Details
-
UrlBuilder
public UrlBuilder() -
UrlBuilder
-
UrlBuilder
- Throws:
MalformedURLException
-
UrlBuilder
- Throws:
MalformedURLException
-
UrlBuilder
public UrlBuilder(String aUrl, FormFields aQueryFields, String aFragment) throws MalformedURLException - Throws:
MalformedURLException
-
UrlBuilder
-
UrlBuilder
-
UrlBuilder
-
UrlBuilder
public UrlBuilder(org.refcodes.data.Scheme aScheme, String aHost, int aPort, String aPath, FormFields aQueryFields, String aFragment) -
UrlBuilder
public UrlBuilder(org.refcodes.data.Scheme aScheme, String aHost, int aPort, String aPath, FormFields aQueryFields) -
UrlBuilder
-
UrlBuilder
public UrlBuilder(org.refcodes.data.Scheme aScheme, String aHost, String aPath, FormFields aQueryFields, String aFragment) -
UrlBuilder
public UrlBuilder(org.refcodes.data.Scheme aScheme, String aHost, String aPath, FormFields aQueryFields) -
UrlBuilder
-
UrlBuilder
public UrlBuilder(String aProtocol, String aHost, int aPort, String aPath, FormFields aQueryFields, String aFragment) -
UrlBuilder
-
UrlBuilder
-
UrlBuilder
-
UrlBuilder
public UrlBuilder(String aProtocol, String aHost, String aPath, FormFields aQueryFields, String aFragment) -
UrlBuilder
-
UrlBuilder
-
UrlBuilder
-
UrlBuilder
-
UrlBuilder
-
-
Method Details
-
fromUrl
- Overrides:
fromUrlin classUrl- Parameters:
aUrl- The URL from which to determine the state.- Throws:
MalformedURLException- in case the provided URL is considered being malformed.
-
fromURL
-
withScheme
Sets the UrlScheme for the URL scheme.- Specified by:
withSchemein interfaceSchemeAccessor.SchemeBuilder<UrlBuilder>- Parameters:
aScheme- The UrlScheme to be stored by the URL scheme.- Returns:
- The builder for applying multiple build operations.
-
withProtocol
Sets the protocol for the URL scheme.- Specified by:
withProtocolin interfaceSchemeAccessor.SchemeBuilder<UrlBuilder>- Parameters:
aProtocol- The protocol to be stored by the URL scheme.- Returns:
- The builder for applying multiple build operations.
-
withHost
Sets the host to use and returns this builder as of the builder pattern.- Specified by:
withHostin interfaceHostAccessor.HostBuilder<UrlBuilder>- Parameters:
aHost- The host to be stored by the host property.- Returns:
- This
HostAccessor.HostBuilderinstance to continue configuration.
-
withIpAddress
- Specified by:
withIpAddressin interfaceorg.refcodes.net.IpAddressAccessor.IpAddressBuilder<UrlBuilder>
-
withCidrNotation
- Specified by:
withCidrNotationin interfaceorg.refcodes.net.IpAddressAccessor.IpAddressBuilder<UrlBuilder>
-
withPort
- Specified by:
withPortin interfaceorg.refcodes.mixin.PortAccessor.PortBuilder<UrlBuilder>
-
withPath
- Specified by:
withPathin interfaceorg.refcodes.mixin.PathAccessor.PathBuilder<UrlBuilder>
-
appendToPath
Appends a path element to the path.- Parameters:
aPathElement- The path element to be appended.
-
appendToPath
Appends multiple path elements to the path, automatically adding the path separator "/" as required.- Parameters:
aPathElements- The path elements to be appended.
-
withAppendToPath
Appends a path element to the path as of the Builder-Pattern.- Parameters:
aPath- The path element to be appended.- Returns:
- This
UrlBuilderinstance to continue configuration.
-
withAppendToPath
Appends multiple path elements to the path, automatically adding the path separator "/" as required as of the Builder-Pattern.- Parameters:
aPathElements- The path elements to be appended.- Returns:
- This
UrlBuilderinstance to continue configuration.
-
withQueryFields
Sets the request Query-Fields to use and returns this builder as of the Builder-Pattern.- Specified by:
withQueryFieldsin interfaceQueryFieldsAccessor.QueryFieldsBuilder<UrlBuilder>- Parameters:
aQueryFields- The request Query-Fields to be stored by the form fields property.- Returns:
- This
FormFieldsAccessor.FormFieldsBuilderinstance to continue configuration.
-
addToQueryFields
Adds a value to the list of values associated with the given Query-Field (key).- Parameters:
aField- The Query-Field (key) of which's list of values a value is to be added.aValue- The value to be added to the list of values associated to the given Query-Field (key).
-
addToQueryFields
Adds values to the list of values associated with the given Query-Field (key).- Parameters:
aField- The Query-Field (key) of which's list of values the values are to be added.aValues- The values to be added to the list of values associated to the given Query-Field (key).
-
withAddToQueryFields
Adds a value to the list of values associated with the given Query-Field (key) and returns this builder as of the Builder-Pattern.- Parameters:
aField- The Query-Field (key) of which's list of values a value is to be added.aValue- The value to be added to the list of values associated to the given Query-Field (key).- Returns:
- This
UrlBuilderinstance to continue configuration.
-
withAddToQueryFields
Adds values to the list of values associated with the given Query-Field (key) and returns this builder as of the Builder-Pattern.- Parameters:
aField- The Query-Field (key) of which's list of values the values are to be added.aValues- The values to be added to the list of values associated to the given Query-Field (key).- Returns:
- This
UrlBuilderinstance to continue configuration.
-
withFragment
Sets the fragment to use and returns this builder as of the builder pattern.- Specified by:
withFragmentin interfaceFragmentAccessor.FragmentBuilder<UrlBuilder>- Parameters:
aFragment- The fragment to be stored by the fragment property.- Returns:
- This
FragmentAccessor.FragmentBuilderinstance to continue configuration.
-
withIdentity
- Specified by:
withIdentityin interfaceorg.refcodes.mixin.IdentityAccessor.IdentityBuilder<UrlBuilder>
-
withSecret
- Specified by:
withSecretin interfaceorg.refcodes.mixin.SecretAccessor.SecretBuilder<UrlBuilder>
-
setScheme
public void setScheme(org.refcodes.data.Scheme aScheme) Sets the UrlScheme for the URL scheme.- Specified by:
setSchemein interfaceSchemeAccessor.SchemeMutator- Overrides:
setSchemein classUrl- Parameters:
aScheme- The UrlScheme to be stored by the URL scheme.
-
setProtocol
Sets the protocolStringrepresentation for the scheme property. You must provide the scheme's specific part as well. In case of HTTP, provide "http://". In case your provided protocol is unknown by theSchemeenumeration, then the scheme property will not be set, though theSchemeAccessor.toProtocol()still returns your protocol.- Specified by:
setProtocolin interfaceSchemeAccessor.SchemeMutator- Overrides:
setProtocolin classUrl- Parameters:
aProtocol- The UrlScheme'sStringrepresentation to be stored by the URL scheme.
-
setHost
Sets the host for the host property.- Specified by:
setHostin interfaceHostAccessor.HostMutator- Overrides:
setHostin classUrl- Parameters:
aHost- The host to be stored by the host property.
-
setIpAddress
public void setIpAddress(int[] aIpAddress) - Specified by:
setIpAddressin interfaceorg.refcodes.net.IpAddressAccessor.IpAddressMutator- Overrides:
setIpAddressin classUrl
-
setPort
public void setPort(int aPort) -
setPath
-
setQueryFields
Sets the request Query-Fields for the request Query-Fields property.- Specified by:
setQueryFieldsin interfaceQueryFieldsAccessor.QueryFieldsMutator- Parameters:
aQueryFields- The request Query-Fields to be stored by the form fields property.
-
setFragment
Sets the fragment for the fragment property.- Specified by:
setFragmentin interfaceFragmentAccessor.FragmentMutator- Parameters:
aFragment- The fragment to be stored by the fragment property.
-
setIdentity
- Specified by:
setIdentityin interfaceorg.refcodes.mixin.IdentityAccessor.IdentityMutator
-
setSecret
- Specified by:
setSecretin interfaceorg.refcodes.mixin.SecretAccessor.SecretMutator
-
toString
-