Class OEmbedProvider.Endpoint

java.lang.Object
com.attribyte.parser.model.OEmbedProvider.Endpoint
Enclosing class:
OEmbedProvider

public static class OEmbedProvider.Endpoint extends Object
  • Field Details

    • patterns

      public final com.google.common.collect.ImmutableList<Pattern> patterns
      A list of patterns for each scheme.
    • schemes

      public final com.google.common.collect.ImmutableList<String> schemes
      The immutable list of schemes.
    • url

      public final String url
      The endpoint URL.
  • Constructor Details

    • Endpoint

      public Endpoint(String url, Collection<String> schemes)
      Creates an endpoint.
      Parameters:
      url - The endpoint URL.
      schemes - The collection of schemes.
  • Method Details

    • toString

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

      public final URL buildRequestURL(String url, String format) throws MalformedURLException
      Creates the oembed request URL.
      Parameters:
      url - The input URL (should match one of the patterns).
      format - The format, e.g. json.
      Returns:
      The oembed URL.
      Throws:
      MalformedURLException - If URL is invalid.
    • matches

      public final boolean matches(String url)
      Determine if a URL matches any of the supported schemes.
      Parameters:
      url - The URL.
      Returns:
      Does this endpoint support the URL?