Interface RelativeUrl

All Superinterfaces:
org.wiremock.stringparser.ParsedString, Uri, Url
All Known Subinterfaces:
PathAndQuery, SchemeRelativeUrl

public non-sealed interface RelativeUrl extends Url
Represents a relative reference as defined in RFC 3986 Section 4.2.

A relative reference is a URI reference that does not have a scheme component. It can have an authority, path, query, and fragment. Relative references are typically resolved against a base URI to produce another URI.

Implementations must be immutable and thread-safe.

See Also:
  • Method Details

    • getScheme

      @Deprecated default @Nullable Scheme getScheme()
      Deprecated.
      This always returns null so you have no reason to ever call it
      Implementations must ALWAYS return null
      Specified by:
      getScheme in interface Uri
      Returns:
      null
    • isRelative

      default boolean isRelative()
      Description copied from interface: Uri
      Returns true if this is a relative reference (has no scheme).
      Specified by:
      isRelative in interface Uri
      Returns:
      true if this is a relative reference
    • isAbsolute

      default boolean isAbsolute()
      Description copied from interface: Uri
      Returns true if this is an absolute URI (either an absolute URL or an Opaque URI).
      Specified by:
      isAbsolute in interface Uri
      Returns:
      true if this is an absolute URI
    • isAbsoluteUrl

      default boolean isAbsoluteUrl()
      Description copied from interface: Uri
      Returns true if this is an absolute URL (has a scheme and authority).
      Specified by:
      isAbsoluteUrl in interface Uri
      Returns:
      true if this is an absolute URL
    • isOpaqueUri

      default boolean isOpaqueUri()
      Description copied from interface: Uri
      Returns true if this is an Opaque URI (has a scheme but no authority).
      Specified by:
      isOpaqueUri in interface Uri
      Returns:
      true if this is an Opaque URI
    • thaw

      default RelativeUrl.Transformer thaw()
      Description copied from interface: Url
      Creates a transformer initialized with the values from this URL.
      Specified by:
      thaw in interface Url
      Returns:
      a transformer
    • parse

      static RelativeUrl parse(String relativeRef) throws IllegalRelativeUrl
      Parses a string into a relative reference.
      Parameters:
      relativeRef - the string to parse
      Returns:
      the parsed relative reference
      Throws:
      IllegalRelativeUrl - if the string is not a valid relative reference
    • builder

      static RelativeUrl.Builder builder()
      Creates a new builder
      Returns:
      a new builder
    • builder

      static RelativeUrl.Builder builder(RelativeUrl url)
      Creates a builder initialized with the values from the given URL.
      Parameters:
      url - the URL to copy values from
      Returns:
      a new builder