Class NormURL

  • All Implemented Interfaces:
    kotlin.Comparable

    
    public class NormURL
     implements Comparable<NormURL>
                        

    NormURL stands for normal url, which means the url is final and will be used to locate the resource.

    Every normal url contains two urls: a url and a href, url stands for Uniform Resource Locator, both for external webpage and internal database record, and href stands for Hyperlink Reference, which contains a url extracted from an HTML document.

    Href is the first choice to locate resources, because it's extracted from the HTML document without modification, while url is typically normalized.

    • Constructor Detail

      • NormURL

        NormURL(String spec, LoadOptions options, String hrefSpec, UrlAware detail)
        Construct a NormURL from a string url and a LoadOptions object.
    • Method Detail

      • getUrl

         final URL getUrl()

        The url is final and will be used to locate the resource.

      • getHref

         final URL getHref()

        The href is the raw url in the html without normalization, for example, an url with a timestamp query parameter added.

        The href is the first choice to locate resources, because it's extracted from the HTML document without modification, while url is typically normalized.

      • setHref

         final Unit setHref(URL href)

        The href is the raw url in the html without normalization, for example, an url with a timestamp query parameter added.

        The href is the first choice to locate resources, because it's extracted from the HTML document without modification, while url is typically normalized.

      • getDetail

         final UrlAware getDetail()

        A url aware object that contains the url and its related information.

      • setDetail

         final Unit setDetail(UrlAware detail)

        A url aware object that contains the url and its related information.

      • component1

         final String component1()

        The 1st-component, which is the url specification.

      • hashCode

         Integer hashCode()

        The hash code of the object.

        Returns:

        the hash code of the object

      • equals

         Boolean equals(Object other)

        Whether the object is equal to this object.

        Parameters:
        other - the object to be compared
        Returns:

        whether the object is equal to this object

      • compareTo

         Integer compareTo(NormURL other)

        Compare this object to another object.

        Parameters:
        other - the object to be compared
        Returns:

        the comparison result

      • toString

         String toString()

        The string representation of the object.

        Returns:

        the string representation of the object

      • parse

         final static NormURL parse(String configuredUrl, VolatileConfig volatileConfig)

        Parse a configured url to a NormURL object.

        Parameters:
        configuredUrl - the configured url to be parsed
        volatileConfig - the volatile configuration
        Returns:

        the parsed NormURL object