Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: expose the items count API to components #9257

Merged
merged 1 commit into from
Oct 28, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -872,14 +872,18 @@ public void setFetchEnabled(boolean fetchEnabled) {
}

/**
* Getter method for determining the item count of the data. Can be
* overridden by a subclass that uses a specific type of DataProvider and/or
* query.
* Getter method for determining the item count of the data.
* <p>
* This method should be used only with defined size, i.e. when
* {@link #isDefinedSize()} returns {@code code}.
* <p>
* Can be overridden by a subclass that uses a specific type of DataProvider
* and/or query.
*
* @return the size of data provider with current filter
*/
@SuppressWarnings({ "unchecked", "rawtypes" })
protected int getDataProviderSize() {
public int getDataProviderSize() {
assert definedSize : "This method should never be called when using undefined size";
if (countCallback != null) {
return countCallback.count(new Query(getFilter()));
Expand Down