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 methodBrowserModel.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,ListProvideris used as anonymous inner class to pass the list information.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classListProvider.ListInfoAdditional information about the contained list.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description TgetFirst()Gets the first element of the provided list.java.util.List<T>getList()Gets the list.ListProvider.ListInfogetListInfo()Gets theListProvider.ListInfofor the provided list.intgetListSize()Gets the size of the provided list or -1, if unknown.
-
-
-
Method Detail
-
getList
java.util.List<T> 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.
-
-