return pagesCount;
}
private LayoutSlot getLayoutSlotForCurrentTarget(IFRenderContext context) {
if (currentLayoutSlot != null) return currentLayoutSlot;
final Optional<LayoutSlot> layoutSlotOptional = context.getLayoutSlots().stream()
.filter(layoutSlot -> layoutSlot.getCharacter() == getLayoutTarget())
.findFirst();
if (!layoutSlotOptional.isPresent())
// TODO more detailed error message
throw new IllegalArgumentException(String.format("Layout slot target not found: %c", getLayoutTarget()));
return (currentLayoutSlot = layoutSlotOptional.get());
}
/**
* Calculates the number of pages available based on a given source.
*
https://github.com/DevNatan/inventory-framework/blob/09ee0f14910ea3ab906136bea558806762b8af3e/inventory-framework-core/src/main/java/me/devnatan/inventoryframework/component/PaginationImpl.java#L249