Skip to content

Instantly share code, notes, and snippets.

@derklaro
Created January 17, 2022 16:37
Show Gist options
  • Save derklaro/55d195ab84e57639914483a329fcf132 to your computer and use it in GitHub Desktop.
Save derklaro/55d195ab84e57639914483a329fcf132 to your computer and use it in GitHub Desktop.
private final SpigetClient client = new Java11SpigetClient(GsonMapper.INSTANCE);
public void listAndPrintCategories() {
client.categoryList().size(5).exec().whenComplete((result, exception) -> {
if (exception != null) {
System.err.println("Unable to fetch because " + exception.getMessage());
} else {
result.forEach(category -> System.out.println(category.name()));
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment