Package com.afrunt.randomjoke.suppliers
Class AbstractJokeSupplier
- java.lang.Object
-
- com.afrunt.randomjoke.suppliers.AbstractJokeSupplier
-
- All Implemented Interfaces:
java.util.function.Supplier<Joke>
- Direct Known Subclasses:
BashOrg,ChuckNorris,Dkatz,GeekJoke,GoodBadJokes,ICanHazDadJoke,SecondChuckNorris
public abstract class AbstractJokeSupplier extends Object implements java.util.function.Supplier<Joke>
- Author:
- Andrii Frunt
-
-
Constructor Summary
Constructors Constructor Description AbstractJokeSupplier()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract StringgetSource()protected InputStreaminputStreamFromUrl(String url)protected org.json.JSONObjectinputStreamToJsonObject(InputStream is)protected StringinputStreamToString(InputStream is)protected org.json.JSONObjectjsonObjectFromUrl(String url)protected org.json.JSONObjectjsonObjectFromUrl(String url, Map<String,String> headers)protected HttpURLConnectionopenConnection(String url)protected StringremoveSurroundingQuotes(String text)protected StringstringFromUrl(String url)protected org.htmlcleaner.TagNodetagNodeFromUrl(String url)protected org.htmlcleaner.TagNodetagNodeFromUrl(String url, Map<String,String> headers)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.function.Supplier
get
-
-
-
-
Method Detail
-
getSource
public abstract String getSource()
-
inputStreamToString
protected String inputStreamToString(InputStream is)
-
inputStreamToJsonObject
protected org.json.JSONObject inputStreamToJsonObject(InputStream is)
-
jsonObjectFromUrl
protected org.json.JSONObject jsonObjectFromUrl(String url, Map<String,String> headers)
-
tagNodeFromUrl
protected org.htmlcleaner.TagNode tagNodeFromUrl(String url)
-
tagNodeFromUrl
protected org.htmlcleaner.TagNode tagNodeFromUrl(String url, Map<String,String> headers)
-
jsonObjectFromUrl
protected org.json.JSONObject jsonObjectFromUrl(String url)
-
inputStreamFromUrl
protected InputStream inputStreamFromUrl(String url)
-
openConnection
protected HttpURLConnection openConnection(String url)
-
-