java.lang.Object
com.github.mjeanroy.junit.servers.client.HttpUrl

public class HttpUrl extends Object
URL object without:
  • Authority part.
  • Query string.
  • Fragment.
  • Method Details

    • parse

      public static HttpUrl parse(String endpoint)
      Parse URL string to create new HttpUrl instance.
      Parameters:
      endpoint - URL value.
      Returns:
      The final HttpUrl instance.
      Throws:
      IllegalArgumentException - If URL is malformed.
    • getScheme

      public String getScheme()
      Get URL Scheme.
      Returns:
      URL Scheme.
      See Also:
      • scheme
    • getHost

      public String getHost()
      Get URL Host.
      Returns:
      URL Host.
      See Also:
      • host
    • getPort

      public int getPort()
      Get URL Port.
      Returns:
      URL Port.
      See Also:
      • port
    • getPath

      public String getPath()
      Get URL Path.
      Returns:
      URL Path.
      See Also:
      • path
    • toURI

      public URI toURI()
      Create new URI from URL fields.
      Returns:
      URI instance.
      Throws:
      IllegalArgumentException - If URI cannot be built because of URISyntaxException.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object