public class DefaultCommerceEntryGroupUtils extends java.lang.Object implements CommerceEntryGroupUtils
CommerceEntryGroupUtils.| Constructor and Description |
|---|
DefaultCommerceEntryGroupUtils() |
| Modifier and Type | Method and Description |
|---|---|
int |
findMaxGroupNumber(java.util.List<EntryGroupData> roots)
Returns max value of
EntryGroupData#groupNumber. |
EntryGroupData |
getGroup(AbstractOrderData order,
java.util.Collection<java.lang.Integer> groupNumbers,
GroupType groupType)
Searches for entry group which is a type of
groupType and which number belongs to the groupNumbers. |
EntryGroupData |
getGroup(AbstractOrderData order,
java.lang.Integer groupNumber)
Returns
EntryGroupData by groupNumber from given order |
java.util.List<EntryGroupData> |
getLeaves(EntryGroupData root)
Returns all leaf nodes of group tree, preventing their natural order.
|
java.util.List<EntryGroupData> |
getNestedGroups(EntryGroupData root)
Flatten group tree and return it as a plain list of groups.
|
public java.util.List<EntryGroupData> getNestedGroups(EntryGroupData root)
CommerceEntryGroupUtilsThe method keeps item order unchanged: first goes root item, then its first child, then the children of that child and so forth.
getNestedGroups in interface CommerceEntryGroupUtilsroot - node to start collecting frompublic java.util.List<EntryGroupData> getLeaves(EntryGroupData root)
CommerceEntryGroupUtilsgetLeaves in interface CommerceEntryGroupUtilsroot - root node of group treepublic EntryGroupData getGroup(AbstractOrderData order, java.lang.Integer groupNumber)
CommerceEntryGroupUtilsEntryGroupData by groupNumber from given ordergetGroup in interface CommerceEntryGroupUtilsorder - order containing entry group treesgroupNumber - number of the group to search forEntryGroupData with given groupNumber from the orderpublic EntryGroupData getGroup(AbstractOrderData order, java.util.Collection<java.lang.Integer> groupNumbers, GroupType groupType)
CommerceEntryGroupUtilsgroupType and which number belongs to the groupNumbers.getGroup in interface CommerceEntryGroupUtilsorder - order what is expected to contain the desired groupgroupNumbers - possible group numbers. Usually are taken from
OrderEntryData.getEntryGroupNumbers()groupType - desired group typepublic int findMaxGroupNumber(java.util.List<EntryGroupData> roots)
CommerceEntryGroupUtilsEntryGroupData#groupNumber.findMaxGroupNumber in interface CommerceEntryGroupUtilsroots - root groupsCopyright © 2018 SAP SE. All Rights Reserved.