Class MappingService
java.lang.Object
de.hybris.platform.cockpit.services.MappingService
Service for mapping arbitrary items to arbitrary keys.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceAKeyProviderprovides a key, to be used for the mapping of a specific item. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionmapItems(MappingService.KeyProvider keyProvider, Collection<? extends Object> items) Maps all the items initemsto corresponding keys retrieved by theMappingService.KeyProviderkp, i.e.
-
Constructor Details
-
MappingService
public MappingService()
-
-
Method Details
-
mapItems
public static Map<Object,Object> mapItems(MappingService.KeyProvider keyProvider, Collection<? extends Object> items) throws IllegalArgumentException Maps all the items initemsto corresponding keys retrieved by theMappingService.KeyProviderkp, i.e. each entry will look like this (itembeing an element initems):<kp.getKey(item), item>- Parameters:
keyProvider- theMappingService.KeyProviderused for mapping itemsitems- the items to be mapped- Returns:
- a map with a value set corresponding to the elements of
itemsand a key set corresponding to the keys retrieved by the specifiedMappingService.KeyProvider - Throws:
IllegalArgumentException- if no key could be retrieved for a specific item initemsusing the specifiedMappingService.KeyProviderkp.- See Also:
-