Skip to content

Commit 951f0a3

Browse files
authored
fix: HierarchicalDataCommunicator doesn't support estimates (#19784)
Fixes #19772
1 parent 95e9aff commit 951f0a3

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

flow-data/src/main/java/com/vaadin/flow/data/provider/hierarchy/HierarchicalDataCommunicator.java

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -615,4 +615,57 @@ protected String createKey() {
615615
}
616616
}
617617

618+
/**
619+
* Estimates are not supported in HierarchicalDataCommunicator
620+
*/
621+
@Override
622+
public void setItemCountEstimate(int itemCountEstimate) {
623+
throw new UnsupportedOperationException(
624+
"Not supported in HierarchicalDataCommunicator");
625+
}
626+
627+
/**
628+
* Estimates are not supported in HierarchicalDataCommunicator
629+
*/
630+
@Override
631+
public int getItemCountEstimate() {
632+
throw new UnsupportedOperationException(
633+
"Not supported in HierarchicalDataCommunicator");
634+
}
635+
636+
/**
637+
* Estimates are not supported in HierarchicalDataCommunicator
638+
*/
639+
@Override
640+
public void setItemCountEstimateIncrease(int itemCountEstimateIncrease) {
641+
throw new UnsupportedOperationException(
642+
"Not supported in HierarchicalDataCommunicator");
643+
}
644+
645+
/**
646+
* Estimates are not supported in HierarchicalDataCommunicator
647+
*/
648+
@Override
649+
public int getItemCountEstimateIncrease() {
650+
throw new UnsupportedOperationException(
651+
"Not supported in HierarchicalDataCommunicator");
652+
}
653+
654+
/**
655+
* Estimates are not supported in HierarchicalDataCommunicator
656+
*/
657+
@Override
658+
public void setDefinedSize(boolean definedSize) {
659+
throw new UnsupportedOperationException(
660+
"Not supported in HierarchicalDataCommunicator");
661+
}
662+
663+
/**
664+
* Estimates are not supported in HierarchicalDataCommunicator. Therefore
665+
* this method will always return {@literal true}
666+
*/
667+
@Override
668+
public boolean isDefinedSize() {
669+
return true;
670+
}
618671
}

0 commit comments

Comments
 (0)