Interface EntitlementPaginationAction

All Superinterfaces:
Iterable<Entitlement>, PaginationAction<Entitlement,EntitlementPaginationAction>, RestAction<@Unmodifiable List<Entitlement>>

public interface EntitlementPaginationAction extends PaginationAction<Entitlement,EntitlementPaginationAction>
PaginationAction that paginates the application entitlements endpoint.

By default, JDA will include Entitlements which have ended, that is, Entitlements which have gone past their timeEnding. You may use excludeEnded(true) to only return Entitlements which are still active

Minimum - 1
Maximum - 100
Default - 100


 //Fetch all entitlements for a given SKU id
 public static void fetchEntitlements(JDA api, String skuId, Consumer<List<Entitlement>> callback) {
     List<Entitlement> entitlements = new ArrayList<>()
     EntitlementPaginationAction action = api.retrieveEntitlements().skuIds(skuId).excludeEnded(true)
     action.forEachAsync((entitlement) -> {
           return true; //continues to retrieve all entitlements until there are none left to retrieve
     }.thenRun(() -> callback.accept(entitlements));