As a ...
I need to be able to ...
count from zero if I feel like it.
Which enables me to ...
pretend I'm Donald Knuth.
Additional information
Folks with CS degrees have a weird fetish for counting from 0 instead of from 1 like mathematicians and other normal people. This came up in #941.
Since Jakarta Data is an inclusive specification, we should consider catering to the needs of both nerds and normies. I would do this not by some 🤮global configuration property (as previously proposed), but rather by exposing both "page numbers" and "page indexes" in the PageRequest interface.
This would involve something the following additions:
default long index() {
return page() - 1;
}
default PageRequest index(long pageIndex) {
return page(pageIndex + 1);
}
static PageRequest atIndex(long index) {
return ofPage(index + 1);
}
static PageRequest atIndex(long index, int maxPageSize, boolean requestTotal) {
return ofPage(index + 1, maxPageSize, requestTotal);
}
Perhaps something similar should be done in Limit.
cc @FroMage
As a ...
I need to be able to ...
count from zero if I feel like it.
Which enables me to ...
pretend I'm Donald Knuth.
Additional information
Folks with CS degrees have a weird fetish for counting from 0 instead of from 1 like mathematicians and other normal people. This came up in #941.
Since Jakarta Data is an inclusive specification, we should consider catering to the needs of both nerds and normies. I would do this not by some 🤮global configuration property (as previously proposed), but rather by exposing both "page numbers" and "page indexes" in the
PageRequestinterface.This would involve something the following additions:
Perhaps something similar should be done in
Limit.cc @FroMage