Package de.hybris.platform.cockpit.util
Interface ListProvider<T>
public interface ListProvider<T>
This interface provides the functionality to pass a list as an argument to methods without retrieving it's elements
and can be used to avoid performance issues.
Example: The inspector functionality in the cockpit displays additional information for the currently selected items, so the method
Example: The inspector functionality in the cockpit displays additional information for the currently selected items, so the method
BrowserModel.getSelectedItems() must be invoked somewhere to pass its result to the inspector
renderer. Since this can be a performance killer when CTRL+A was pressed and thousands of items are selected and it
may not be useful to show all this items in the inspector but e.g. only the number of selected items,
ListProvider is used as anonymous inner class to pass the list information.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumAdditional information about the contained list. -
Method Summary
Modifier and TypeMethodDescriptiongetFirst()Gets the first element of the provided list.getList()Gets the list.Gets theListProvider.ListInfofor the provided list.intGets the size of the provided list or -1, if unknown.
-
Method Details
-
getList
Gets the list. -
getFirst
T getFirst()Gets the first element of the provided list.- Returns:
- the first element or null, if list is empty.
-
getListInfo
ListProvider.ListInfo getListInfo()Gets theListProvider.ListInfofor the provided list.- Returns:
- A
ListProvider.ListInfoinstance or null, if undefined.
-
getListSize
int getListSize()Gets the size of the provided list or -1, if unknown.
-