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.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      public class NormURL.Companion
    • Constructor Summary

      Constructors 
      Constructor Description
      NormURL(String spec, LoadOptions options, String hrefSpec, UrlAware detail) Construct a NormURL from a string url and a LoadOptions object.
      NormURL(URL url, LoadOptions options, URL href, UrlAware detail)
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final String getSpec()
      final String getUrlString()
      final String getHrefSpec()
      final String getArgs()
      final <Error class: unknown class> getUrlSpec()
      final <Error class: unknown class> getConfiguredUrl()
      final String getReferrer()
      final Boolean isNil()
      final Boolean isNotNil()
      final URL getUrl() The url is final and will be used to locate the resource.
      final LoadOptions getOptions() The load options to be used to load the resource.
      final URL getHref() The href is the raw url in the html without normalization, for example, a url with a timestamp query parameter added.
      final Unit setHref(URL href) The href is the raw url in the html without normalization, for example, a url with a timestamp query parameter added.
      final UrlAware getDetail() A url aware object that contains the url and its related information.
      final Unit setDetail(UrlAware detail) A url aware object that contains the url and its related information.
      final URL component1() The 1st-component, which is the url specification.
      final LoadOptions component2() The 2nd-component, which is the load options.
      Integer hashCode() The hash code of the object.
      Boolean equals(Object other) Whether the object is equal to this object.
      <Error class: unknown class> compareTo(NormURL other) Compare this object to another object.
      <Error class: unknown class> toString() The string representation of the object.
      final static NormURL parse(String configuredUrl, VolatileConfig volatileConfig) Parse a configured url to a NormURL object.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • NormURL

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

        NormURL(URL url, LoadOptions options, URL href, UrlAware detail)
    • Method Detail

      • getUrlSpec

         final <Error class: unknown class> getUrlSpec()
      • isNil

         final Boolean isNil()
      • 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, a 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, a 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 URL 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

         <Error class: unknown class> compareTo(NormURL other)

        Compare this object to another object.

        Parameters:
        other - the object to be compared
        Returns:

        the comparison result

      • toString

         <Error class: unknown class> 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