Class URLShortener


  • public abstract class URLShortener
    extends java.lang.Object
    An interface to a web-based URL Shortener. Classes extending this should implement its methods to shorten links using the service. Given some URLShortener instance us, a URL is shortened by: us.shorten(longUrl); An example of this, is the BitlyURLShortener.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      abstract java.lang.String shorten​(java.lang.String longUrl)
      Shorten a URL.
      • Methods inherited from class java.lang.Object

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

      • shorten

        public abstract java.lang.String shorten​(java.lang.String longUrl)
        Shorten a URL.
        Parameters:
        longUrl - The long form.
        Returns:
        The shortened URL.