Java API client for The Internet Chuck Norris Database (http://www.icndb.com/)
Everyting depend on ICNDBClient client object
import net.joningi.icndb.ICNDBClient;
....
final ICNDBClient client = new ICNDBClient();
import net.joningi.icndb.Joke;
...
Joke joke = client.getById(15);
System.out.println(joke.getId() + ": " + joke.getJoke());
Joke randomJoke = client.getRandom();
for (Joke j : client.getRandom(10)) {
System.out.println(j.getId() + ": " + j.getJoke());
}
client.setFirstName("Bill");
client.setLastName("Clinton");
Joke randomJoke = client.getRandom();
client.clearName();
System.out.println(client.getCount());
for (String category : client.getCategories()) {
System.out.println(category);
}
client.setExclude(Lists.newArrayList("explicit", "nerdy"));
Joke randomJoke = client.getRandom();
client.clearLimitAndExclude();
client.setLimitTo(Lists.newArrayList("explicit", "nerdy"));
Joke randomJoke = client.getRandom();
client.clearLimitAndExclude();