Class UrlSugar


  • public class UrlSugar
    extends Object
    Declarative syntactic sugar which may be statically imported in order to allow declarative definitions for Url (Url.UrlBuilder) creation and tweaking: import static org.refcodes.web.UrlSugar.*;
    • Constructor Detail

      • UrlSugar

        public UrlSugar()
    • Method Detail

      • toUrl

        public Url.UrlBuilder toUrl​(org.refcodes.data.Scheme aScheme,
                                    String aHost)
        Constructs an Url.UrlBuilder with the common attributes.
        Parameters:
        aScheme - The Scheme (e.g. HTTP or HTTPS) to be used for the destination URL.
        aHost - The host to which the destination URL is to point to.
        Returns:
        The accordingly constructed Url.UrlBuilder instance.
      • toUrl

        public Url.UrlBuilder toUrl​(org.refcodes.data.Scheme aScheme,
                                    String aHost,
                                    int aPort)
        Constructs an Url.UrlBuilder with the common attributes.
        Parameters:
        aScheme - The Scheme (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.
        Returns:
        The accordingly constructed Url.UrlBuilder instance.
      • toUrl

        public Url.UrlBuilder toUrl​(org.refcodes.data.Scheme aScheme,
                                    String aHost,
                                    int aPort,
                                    String aPath)
        Constructs an Url.UrlBuilder with the common attributes.
        Parameters:
        aScheme - The Scheme (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.
        Returns:
        The accordingly constructed Url.UrlBuilder instance.
      • toUrl

        public Url.UrlBuilder toUrl​(org.refcodes.data.Scheme aScheme,
                                    String aHost,
                                    int aPort,
                                    String aPath,
                                    FormFields aQueryFields)
        Constructs an Url.UrlBuilder with the common attributes.
        Parameters:
        aScheme - The Scheme (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.
        Returns:
        The accordingly constructed Url.UrlBuilder instance.
      • toUrl

        public Url.UrlBuilder toUrl​(org.refcodes.data.Scheme aScheme,
                                    String aHost,
                                    int aPort,
                                    String aPath,
                                    FormFields aQueryFields,
                                    String aFragment)
        Constructs an Url.UrlBuilder with the common attributes.
        Parameters:
        aScheme - The Scheme (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.
        aFragment - The fragment to be set.
        Returns:
        The accordingly constructed Url.UrlBuilder instance.
      • toUrl

        public Url.UrlBuilder toUrl​(String aProtocol,
                                    String aHost)
        Constructs an Url.UrlBuilder with the common attributes.
        Parameters:
        aProtocol - The protocol String (e.g. "http://" or "https://") to be used for the destination URL.
        aHost - The host to which the destination URL is to point to.
        Returns:
        The accordingly constructed Url.UrlBuilder instance.
      • toUrl

        public Url.UrlBuilder toUrl​(String aProtocol,
                                    String aHost,
                                    int aPort)
        Constructs an Url.UrlBuilder with the common attributes.
        Parameters:
        aProtocol - The protocol String (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.
        Returns:
        The accordingly constructed Url.UrlBuilder instance.
      • toUrl

        public Url.UrlBuilder toUrl​(String aProtocol,
                                    String aHost,
                                    int aPort,
                                    String aPath)
        Constructs an Url.UrlBuilder with the common attributes.
        Parameters:
        aProtocol - The protocol String (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.
        Returns:
        The accordingly constructed Url.UrlBuilder instance.
      • toUrl

        public Url.UrlBuilder toUrl​(String aProtocol,
                                    String aHost,
                                    int aPort,
                                    String aPath,
                                    FormFields aQueryFields)
        Constructs an Url.UrlBuilder with the common attributes.
        Parameters:
        aProtocol - The protocol String (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.
        Returns:
        The accordingly constructed Url.UrlBuilder instance.
      • toUrl

        public Url.UrlBuilder toUrl​(String aProtocol,
                                    String aHost,
                                    int aPort,
                                    String aPath,
                                    FormFields aQueryFields,
                                    String aFragment)
        Constructs an Url.UrlBuilder with the common attributes.
        Parameters:
        aProtocol - The protocol String (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.
        aFragment - The fragment to be set.
        Returns:
        The accordingly constructed Url.UrlBuilder instance.
      • toUrl

        public Url.UrlBuilder toUrl​(org.refcodes.data.Scheme aScheme,
                                    String aHost,
                                    String aPath)
        Constructs an Url.UrlBuilder with the common attributes.
        Parameters:
        aScheme - The Scheme (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.
        Returns:
        The accordingly constructed Url.UrlBuilder instance.
      • toUrl

        public Url.UrlBuilder toUrl​(org.refcodes.data.Scheme aScheme,
                                    String aHost,
                                    String aPath,
                                    FormFields aQueryFields)
        Constructs an Url.UrlBuilder with the common attributes.
        Parameters:
        aScheme - The Scheme (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.
        Returns:
        The accordingly constructed Url.UrlBuilder instance.
      • toUrl

        public Url.UrlBuilder toUrl​(org.refcodes.data.Scheme aScheme,
                                    String aHost,
                                    String aPath,
                                    FormFields aQueryFields,
                                    String aFragment)
        Constructs an Url.UrlBuilder with the common attributes.
        Parameters:
        aScheme - The Scheme (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.
        Returns:
        The accordingly constructed Url.UrlBuilder instance.
      • toUrl

        public Url.UrlBuilder toUrl​(String aProtocol,
                                    String aHost,
                                    String aPath)
        Constructs an Url.UrlBuilder with the common attributes.
        Parameters:
        aProtocol - The protocol String (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.
        Returns:
        The accordingly constructed Url.UrlBuilder instance.
      • toUrl

        public Url.UrlBuilder toUrl​(String aProtocol,
                                    String aHost,
                                    String aPath,
                                    FormFields aQueryFields)
        Constructs an Url.UrlBuilder with the common attributes.
        Parameters:
        aProtocol - The protocol String (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.
        Returns:
        The accordingly constructed Url.UrlBuilder instance.
      • toUrl

        public Url.UrlBuilder toUrl​(String aProtocol,
                                    String aHost,
                                    String aPath,
                                    FormFields aQueryFields,
                                    String aFragment)
        Constructs an Url.UrlBuilder with the common attributes.
        Parameters:
        aProtocol - The protocol String (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.
        Returns:
        The accordingly constructed Url.UrlBuilder instance.