1 package eu.glsgroup.fpcs.soap.util;
 
    3 import eu.glsgroup.fpcs.datatypes.soap.v1.common.AddOnLiabilityService;
 
    4 import eu.glsgroup.fpcs.datatypes.soap.v1.common.CashService;
 
    5 import eu.glsgroup.fpcs.datatypes.soap.v1.common.CategoryType;
 
    6 import eu.glsgroup.fpcs.datatypes.soap.v1.common.DeliveryAtWorkService;
 
    7 import eu.glsgroup.fpcs.datatypes.soap.v1.common.DepositService;
 
    8 import eu.glsgroup.fpcs.datatypes.soap.v1.common.ExWorksService;
 
    9 import eu.glsgroup.fpcs.datatypes.soap.v1.common.ExchangeService;
 
   10 import eu.glsgroup.fpcs.datatypes.soap.v1.common.HazardousGoodsService;
 
   11 import eu.glsgroup.fpcs.datatypes.soap.v1.common.IdentPINService;
 
   12 import eu.glsgroup.fpcs.datatypes.soap.v1.common.IdentService;
 
   13 import eu.glsgroup.fpcs.datatypes.soap.v1.common.IntercompanyService;
 
   14 import eu.glsgroup.fpcs.datatypes.soap.v1.common.LimitedQuantitiesService;
 
   15 import eu.glsgroup.fpcs.datatypes.soap.v1.common.PickAndReturnService;
 
   16 import eu.glsgroup.fpcs.datatypes.soap.v1.common.PickAndShipService;
 
   17 import eu.glsgroup.fpcs.datatypes.soap.v1.common.Service;
 
   18 import eu.glsgroup.fpcs.datatypes.soap.v1.common.ShipmentService;
 
   19 import eu.glsgroup.fpcs.datatypes.soap.v1.common.ShopDeliveryService;
 
   20 import eu.glsgroup.fpcs.datatypes.soap.v1.common.ShopReturnService;
 
   21 import eu.glsgroup.fpcs.datatypes.soap.v1.common.UnitService;
 
   22 import eu.glsgroup.fpcs.dto.ConsigneeCategory;
 
   24 import java.util.List;
 
   25 import java.util.Optional;
 
   26 import java.util.stream.Collectors;
 
   27 import java.util.stream.Stream;
 
   34         throw new AssertionError(
"ConverterUtils cannot be instantiated.");
 
   39         if (categoryType == null) {
 
   42         switch (categoryType) {
 
   44                 return ConsigneeCategory.PRIVATE;
 
   46                 return ConsigneeCategory.BUSINESS;
 
   48                 throw new IllegalArgumentException(
"Unexpected categoryType '" + categoryType + 
"'");
 
   54         return Stream.of(Optional.ofNullable(unitService.
getCash())
 
   64                      .filter(Optional::isPresent)
 
   66                      .collect(Collectors.toList());
 
   71         return Stream.of(Optional.ofNullable(shipmentService.
getService())
 
   83                          Optional.ofNullable(shipmentService.
getDeposit())
 
   87                          Optional.ofNullable(shipmentService.
getIdent())
 
   93                      .filter(Optional::isPresent)
 
   95                      .collect(Collectors.toList());