Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/khurozov/jokeapi-java
Java wrapper for JokeApi of Sv443
https://github.com/khurozov/jokeapi-java
Last synced: 13 days ago
JSON representation
Java wrapper for JokeApi of Sv443
- Host: GitHub
- URL: https://github.com/khurozov/jokeapi-java
- Owner: khurozov
- License: mit
- Created: 2023-09-08T06:36:30.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2023-09-11T07:34:52.000Z (about 1 year ago)
- Last Synced: 2023-09-11T08:42:48.036Z (about 1 year ago)
- Language: Java
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
JokeAPI Java
=====Java wrapper for [JokeApi](https://v2.jokeapi.dev/) of [Sv443](https://sv443.net/)
## Installation
Add Maven dependency
```xmluz.khurozov
jokeapi-java
1.0```
## Usage example
``` java
JokeApi jokeApi = new JokeApi();// Forming filter:
JokeFilter filter = new JokeFilter.Builder()
.category(Category.Programming)
.blacklistFlags(Set.of(Flag.nsfw, Flag.racist))
.lang(Lang.en)
.idRange(0, 305)
.contains("Java")
.type(Type.twopart)
.build();// Requesting joke(s):
Joke joke = jokeApi.getJoke(filter);
// or
List jokes = jokeApi.getJokes(filter, 2);// Printing joke:
System.out.println(joke.jokeString());
```