Class DefaultCommerceEntryGroupUtils
java.lang.Object
de.hybris.platform.commercefacades.order.impl.DefaultCommerceEntryGroupUtils
- All Implemented Interfaces:
CommerceEntryGroupUtils
Default implementation of
CommerceEntryGroupUtils.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintfindMaxGroupNumber(List<EntryGroupData> roots) Returns max value ofEntryGroupData#groupNumber.getGroup(AbstractOrderData order, Integer groupNumber) ReturnsEntryGroupDataby groupNumber from given ordergetGroup(AbstractOrderData order, Collection<Integer> groupNumbers, GroupType groupType) Searches for entry group which is a type ofgroupTypeand which number belongs to thegroupNumbers.getLeaves(EntryGroupData root) Returns all leaf nodes of group tree, preventing their natural order.Flatten group tree and return it as a plain list of groups.
-
Constructor Details
-
DefaultCommerceEntryGroupUtils
public DefaultCommerceEntryGroupUtils()
-
-
Method Details
-
getNestedGroups
Description copied from interface:CommerceEntryGroupUtilsFlatten group tree and return it as a plain list of groups.The method keeps item order unchanged: first goes root item, then its first child, then the children of that child and so forth.
- Specified by:
getNestedGroupsin interfaceCommerceEntryGroupUtils- Parameters:
root- node to start collecting from- Returns:
- list, that includes the node and all its descendants
-
getLeaves
Description copied from interface:CommerceEntryGroupUtilsReturns all leaf nodes of group tree, preventing their natural order.- Specified by:
getLeavesin interfaceCommerceEntryGroupUtils- Parameters:
root- root node of group tree- Returns:
- leaf nodes
-
getGroup
@Nonnull public EntryGroupData getGroup(@Nonnull AbstractOrderData order, @Nonnull Integer groupNumber) Description copied from interface:CommerceEntryGroupUtilsReturnsEntryGroupDataby groupNumber from given order- Specified by:
getGroupin interfaceCommerceEntryGroupUtils- Parameters:
order- order containing entry group treesgroupNumber- number of the group to search for- Returns:
EntryGroupDatawith given groupNumber from the order
-
getGroup
@Nonnull public EntryGroupData getGroup(@Nonnull AbstractOrderData order, @Nonnull Collection<Integer> groupNumbers, @Nonnull GroupType groupType) Description copied from interface:CommerceEntryGroupUtilsSearches for entry group which is a type ofgroupTypeand which number belongs to thegroupNumbers.- Specified by:
getGroupin interfaceCommerceEntryGroupUtils- Parameters:
order- order what is expected to contain the desired groupgroupNumbers- possible group numbers. Usually are taken fromOrderEntryData.getEntryGroupNumbers()groupType- desired group type- Returns:
- group
-
findMaxGroupNumber
Description copied from interface:CommerceEntryGroupUtilsReturns max value ofEntryGroupData#groupNumber.- Specified by:
findMaxGroupNumberin interfaceCommerceEntryGroupUtils- Parameters:
roots- root groups- Returns:
- maximum group number among the whole forest
-