Package com.afrunt.randomjoke
Class Jokes
- java.lang.Object
-
- com.afrunt.randomjoke.Jokes
-
- All Implemented Interfaces:
HttpOperationsSupport
public class Jokes extends Object implements HttpOperationsSupport
- Author:
- Andrii Frunt
-
-
Constructor Summary
Constructors Constructor Description Jokes()
-
Method Summary
Modifier and Type Method Description JokesaddSupplier(AbstractJokeSupplier supplier)org.htmlcleaner.HtmlCleanergetCleaner()List<AbstractJokeSupplier>getJokeSuppliers()Optional<Joke>randomJoke()List<Joke>randomJokes(int count)List<Joke>randomJokes(int count, int parallelism)Stream<Joke>randomJokeStream()Stream<Joke>randomJokeStream(ExecutorService executor)JokessetJokeSuppliers(List<AbstractJokeSupplier> jokeSuppliers)Jokeswith(Class<? extends AbstractJokeSupplier>... supplierTypes)JokeswithDefaultSuppliers()JokeswithErrorsThreshold(int errorCount)Jokeswithout(Class<? extends AbstractJokeSupplier> supplierType)JokeswithTimeoutThreshold(long millis)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.afrunt.randomjoke.HttpOperationsSupport
inputStreamFromUrl, inputStreamFromUrl, inputStreamToJsonObject, inputStreamToString, jsonObjectFromUrl, jsonObjectFromUrl, openConnection, stringFromUrl, stringFromUrl, stringsFromUrl, tagNodeFromUrl, tagNodeFromUrl
-
-
-
-
Method Detail
-
randomJokeStream
public Stream<Joke> randomJokeStream(ExecutorService executor)
-
withDefaultSuppliers
public Jokes withDefaultSuppliers()
-
without
public Jokes without(Class<? extends AbstractJokeSupplier> supplierType)
-
with
public Jokes with(Class<? extends AbstractJokeSupplier>... supplierTypes)
-
getJokeSuppliers
public List<AbstractJokeSupplier> getJokeSuppliers()
-
setJokeSuppliers
public Jokes setJokeSuppliers(List<AbstractJokeSupplier> jokeSuppliers)
-
addSupplier
public Jokes addSupplier(AbstractJokeSupplier supplier)
-
withErrorsThreshold
public Jokes withErrorsThreshold(int errorCount)
-
withTimeoutThreshold
public Jokes withTimeoutThreshold(long millis)
-
getCleaner
public org.htmlcleaner.HtmlCleaner getCleaner()
- Specified by:
getCleanerin interfaceHttpOperationsSupport
-
-