Converts channel annotations to a channels model.

@param channelAnnotations channelAnnotations
@param knowledgeNamespace knowledgeNamespace
@param componentModel componentModel
@param switchyardNamespace switchyardNamespace
@return a channels model
962450
protected ChannelsModel toChannelsModel(Channel[] channelAnnotations, KnowledgeNamespace knowledgeNamespace, ComponentModel componentModel,
                                            SwitchYardNamespace switchyardNamespace) {
        if (channelAnnotations == null || channelAnnotations.length == 0) {
            return null;
        }
        ChannelsModel channelsModel = new V1ChannelsModel(knowledgeNamespace.uri());
        for (Channel channelAnnotation : channelAnnotations) {
            ChannelModel channelModel = new V1ChannelModel(knowledgeNamespace.uri());
            Class<? extends org.kie.api.runtime.Channel> clazz = channelAnnotation.value();
            if (Channel.UndefinedChannel.class.isAssignableFrom(clazz)) {
                clazz = SwitchYardServiceChannel.class;
            }
            channelModel.setClazz(clazz);
            String name = channelAnnotation.name();
            if (UNDEFINED.equals(name)) {
                if (SwitchYardServiceChannel.class.isAssignableFrom(clazz)) {
                    name = SwitchYardServiceChannel.SERVICE;
                }
            }
            if (UNDEFINED.equals(name)) {
                name = clazz.getSimpleName();
            }
            channelModel.setName(name);
            String operation = channelAnnotation.operation();
            if (!UNDEFINED.equals(operation)) {
                channelModel.setOperation(operation);
            }
            String reference = channelAnnotation.reference();
            if (!UNDEFINED.equals(reference)) {
                channelModel.setReference(reference);
                ComponentReferenceModel componentReferenceModel = new V1ComponentReferenceModel(switchyardNamespace.uri());
                componentReferenceModel.setName(reference);
                Class<?> interfaze = channelAnnotation.interfaze();
                if (!Channel.UndefinedInterface.class.isAssignableFrom(interfaze)) {
                    InterfaceModel interfaceModel = new V1InterfaceModel(InterfaceModel.JAVA);
                    interfaceModel.setInterface(interfaze.getName());
                    componentReferenceModel.setInterface(interfaceModel);
                    componentModel.addReference(componentReferenceModel);
                }
            }
            channelsModel.addChannel(channelModel);
        }
        return channelsModel;
    }
965272
public static List<CPSpecificationOption> toModels(
		CPSpecificationOptionSoap[] soapModels) {
		if (soapModels == null) {
			return null;
		}

		List<CPSpecificationOption> models = new ArrayList<CPSpecificationOption>(soapModels.length);

		for (CPSpecificationOptionSoap soapModel : soapModels) {
			models.add(toModel(soapModel));
		}

		return models;
	}
771117
protected PropertiesModel toPropertiesModel(Property[] propertyAnnotations, KnowledgeNamespace knowledgeNamespace) {
        if (propertyAnnotations == null || propertyAnnotations.length == 0) {
            return null;
        }
        PropertiesModel propertiesModel = new V1PropertiesModel(knowledgeNamespace.uri());
        for (Property propertyAnnotation : propertyAnnotations) {
            PropertyModel propertyModel = new V1PropertyModel(knowledgeNamespace.uri());
            String name = propertyAnnotation.name();
            if (!UNDEFINED.equals(name)) {
                propertyModel.setName(name);
            }
            String value = propertyAnnotation.value();
            if (!UNDEFINED.equals(value)) {
                propertyModel.setValue(value);
            }
            propertiesModel.addProperty(propertyModel);
        }
        return propertiesModel;
    }
272172
private List<io.motown.domain.api.chargingstation.Connector> convertViewModelConnectorsToDomain(Set<Connector> connectors) {
        List<io.motown.domain.api.chargingstation.Connector> resultList = new ArrayList<>(connectors.size());

        for (Connector connector : connectors) {
            resultList.add(new io.motown.domain.api.chargingstation.Connector(connector.getMaxAmp(), connector.getPhase(), connector.getVoltage(),
                    connector.getChargingProtocol(), connector.getCurrent(), connector.getConnectorType()));
        }

        return resultList;
    }
585923
public static List<XmlChannel> toCollectionXmlChannels(Collection<Channel.Builder> channelBuilders) {
		List<XmlChannel> xmlchannels = new ArrayList<XmlChannel>();
		for (Channel.Builder builder : channelBuilders) {
			xmlchannels.add(builder.toXml());
		}
		return xmlchannels;
	}
426781
protected Multimap<Class<? extends Annotation>, Annotation> mergeMemberInterceptorBindings(Multimap<Class<? extends Annotation>, Annotation> beanBindings,
            Set<Annotation> methodBindingAnnotations) {

        Multimap<Class<? extends Annotation>, Annotation> mergedBeanBindings = SetMultimap.newSetMultimap(beanBindings);
        Multimap<Class<? extends Annotation>, Annotation> methodBindings = SetMultimap.newSetMultimap();

        for (Annotation methodBinding : methodBindingAnnotations) {
            methodBindings.put(methodBinding.annotationType(), methodBinding);
        }
        for (Class<? extends Annotation> key : methodBindings.keySet()) {
            mergedBeanBindings.replaceValues(key, methodBindings.get(key));
        }
        return mergedBeanBindings;
    }
754153
public static List<CommerceVirtualOrderItem> toModels(
		CommerceVirtualOrderItemSoap[] soapModels) {
		if (soapModels == null) {
			return null;
		}

		List<CommerceVirtualOrderItem> models = new ArrayList<CommerceVirtualOrderItem>(soapModels.length);

		for (CommerceVirtualOrderItemSoap soapModel : soapModels) {
			models.add(toModel(soapModel));
		}

		return models;
	}
745429
public static List<CommerceNotificationQueueEntry> toModels(
		CommerceNotificationQueueEntrySoap[] soapModels) {
		if (soapModels == null) {
			return null;
		}

		List<CommerceNotificationQueueEntry> models = new ArrayList<CommerceNotificationQueueEntry>(soapModels.length);

		for (CommerceNotificationQueueEntrySoap soapModel : soapModels) {
			models.add(toModel(soapModel));
		}

		return models;
	}
408785
protected ListenersModel toListenersModel(Listener[] listenerAnnotations, KnowledgeNamespace knowledgeNamespace) {
        if (listenerAnnotations == null || listenerAnnotations.length == 0) {
            return null;
        }
        ListenersModel listenersModel = new V1ListenersModel(knowledgeNamespace.uri());
        for (Listener listenerAnnotation : listenerAnnotations) {
            ListenerModel listenerModel = new V1ListenerModel(knowledgeNamespace.uri());
            listenerModel.setClazz(listenerAnnotation.value());
            listenersModel.addListener(listenerModel);
        }
        return listenersModel;
    }
1104418
public static Collection<String> getPropertyNames(Channel channel) {
		Collection<String> propertyNames = new HashSet<String>();
		for (Property property : channel.getProperties()) {
			if (property.getValue() != null)
				propertyNames.add(property.getName());
		}
		return propertyNames;
	}
382020
protected ContainerModel toContainerModel(Container containerAnnotation, KnowledgeNamespace knowledgeNamespace) {
        if (containerAnnotation == null) {
            return null;
        }
        ContainerModel containerModel = new V1ContainerModel(knowledgeNamespace.uri());
        String baseName = containerAnnotation.baseName();
        if (!UNDEFINED.equals(baseName)) {
            containerModel.setBaseName(baseName);
        }
        String releaseId = containerAnnotation.releaseId();
        if (!UNDEFINED.equals(releaseId)) {
            containerModel.setReleaseId(releaseId);
        }
        boolean scan = containerAnnotation.scan();
        if (scan) {
            containerModel.setScan(scan);
        }
        long scanInterval = containerAnnotation.scanInterval();
        if (scanInterval > 0) {
            containerModel.setScanInterval(Long.valueOf(scanInterval));
        }
        String sessionName = containerAnnotation.sessionName();
        if (!UNDEFINED.equals(sessionName)) {
            containerModel.setSessionName(sessionName);
        }
        return containerModel;
    }
1350539
public byte[] getChannelConfigurationSignature(ChannelConfiguration channelConfiguration, User signer)
            throws InvalidArgumentException {

        clientCheck();

        Channel systemChannel = Channel.newSystemChannel(this);
        return systemChannel.getChannelConfigurationSignature(channelConfiguration, signer);

    }
267075
public static List<CommerceAccount> toModels(
		CommerceAccountSoap[] soapModels) {
		if (soapModels == null) {
			return null;
		}

		List<CommerceAccount> models = new ArrayList<CommerceAccount>(soapModels.length);

		for (CommerceAccountSoap soapModel : soapModels) {
			models.add(toModel(soapModel));
		}

		return models;
	}
342770
public static List<CommerceWishList> toModels(
		CommerceWishListSoap[] soapModels) {
		if (soapModels == null) {
			return null;
		}

		List<CommerceWishList> models = new ArrayList<CommerceWishList>(soapModels.length);

		for (CommerceWishListSoap soapModel : soapModels) {
			models.add(toModel(soapModel));
		}

		return models;
	}
1067362
public static ProductChannel createChannel(@Nullable ShoppingProductChannel channel) {
    ProductChannel productChannel = new ProductChannel();
    productChannel.setChannel(channel);
    return productChannel;
  }
265075
protected LoggersModel toLoggersModel(Logger[] loggerAnnotations, KnowledgeNamespace knowledgeNamespace) {
        if (loggerAnnotations == null || loggerAnnotations.length == 0) {
            return null;
        }
        LoggersModel loggersModel = new V1LoggersModel(knowledgeNamespace.uri());
        for (Logger loggerAnnotation : loggerAnnotations) {
            LoggerModel loggerModel = new V1LoggerModel(knowledgeNamespace.uri());
            int interval = loggerAnnotation.interval();
            if (interval > -1) {
                loggerModel.setInterval(interval);
            }
            String log = loggerAnnotation.log();
            if (!UNDEFINED.equals(log)) {
                loggerModel.setLog(log);
            }
            LoggerType loggerType = loggerAnnotation.type();
            if (!LoggerType.THREADED_FILE.equals(loggerType)) {
                loggerModel.setType(loggerType);
            }
            loggersModel.addLogger(loggerModel);
        }
        return loggersModel;
    }
1357892
Channel loadChannel(HFClient client, String channelName) throws NetworkConfigurationException {
        return loadChannel(client, channelName, networkConfigAddPeerHandlerDefault, networkConfigAddOrdererHandlerDefault);
    }