Add collaboration feature
[sdc.git] / openecomp-be / lib / openecomp-sdc-vendor-software-product-lib / openecomp-sdc-vendor-software-product-core / src / main / java / org / openecomp / sdc / vendorsoftwareproduct / dao / impl / zusammen / VspZusammenUtil.java
1 package org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen;
2
3 import com.amdocs.zusammen.adaptor.inbound.api.types.item.ZusammenElement;
4
5 import java.util.Objects;
6
7 class VspZusammenUtil {
8
9   static ZusammenElement aggregateElements(ZusammenElement... elements) {
10     ZusammenElement head = null;
11     ZusammenElement father = null;
12     for (ZusammenElement element : elements) {
13       if (Objects.isNull(head)) {
14         head = father = element;
15       } else {
16         if (father != null) {
17           father.getSubElements().add(element);
18           father = element;
19         }
20       }
21     }
22
23     return head;
24   }
25 }