Converts faults to mappings model.

@param faults faults
@param knowledgeNamespace knowledgeNamespace
@return mappings model
963580
protected FaultsModel toFaultsModel(Fault[] faults, KnowledgeNamespace knowledgeNamespace) {
        FaultsModel faultsModel = null;
        if (faults != null) {
            for (Fault fault : faults) {
                if (fault != null) {
                    FaultModel faultModel = new V1FaultModel(knowledgeNamespace.uri());
                    String from = fault.from();
                    if (!UNDEFINED.equals(from)) {
                        faultModel.setFrom(from);
                    }
                    String to = fault.to();
                    if (!UNDEFINED.equals(to)) {
                        faultModel.setTo(to);
                    }
                    if (faultsModel == null) {
                        faultsModel = new V1FaultsModel(knowledgeNamespace.uri());
                    }
                    faultsModel.addFault(faultModel);
                }
            }
        }
        return faultsModel;
    }
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;
	}
791829
public NamespaceMappings getNamespaceMappings()
    {
        NamespaceMappings mappings = null;
        if (m_handler != null)
        {
            mappings = m_handler.getNamespaceMappings();
        }
        return mappings;
    }
1230049
private List<Metric> mapping(List<Metric> metrics) {
        SystemAssert.requireArgument(metrics != null, "Cannot transform empty metric/metrics");
        if (metrics.isEmpty()) {
            return metrics;
        }

        List<Metric> newMetricsList = new ArrayList<Metric>();

        for (Metric metric : metrics) {
            Map<Long, Double> cleanDatapoints = cleanDPs(metric.getDatapoints());

            metric.setDatapoints(this.valueMapping.mapping(cleanDatapoints));
            newMetricsList.add(metric);
        }
        return newMetricsList;
    }
358090
public List<String> getNamespaces()
   {
      List<String> namespaceList = new ArrayList<String>();
      java.util.Map<String, String> attributes = model.getAttributes();
      for (Entry<String, String> e : attributes.entrySet())
      {
         final String name = e.getKey();
         final String value = e.getValue();
         if (value != null && value.startsWith("http://")) 
         {
            namespaceList.add(name + "=" + value);
         }
      }
      return namespaceList;
   }
792187
public static <K,V> RelationFactory<K,V> mapSet() {
	return mapSet(MapFacts.<K,Set<V>>hash(),
		      SetFacts.<V>hash());
    }
269887
public static Collection<RoboconfError> findWarnings( Collection<? extends RoboconfError> errors ) {

		Collection<RoboconfError> result = new ArrayList<> ();
		for( RoboconfError error : errors ) {
			if( error.getErrorCode().getLevel() == ErrorLevel.WARNING )
				result.add( error );
		}

		return result;
	}
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;
    }
455332
public void setHsms(java.util.Collection<Hsm> hsms) {
        if (hsms == null) {
            this.hsms = null;
            return;
        }

        this.hsms = new java.util.ArrayList<Hsm>(hsms);
    }
170102
public Set<MongoNamespace> getSynchronizedNamespaces() {
    instanceLock.readLock().lock();
    try {
      return new HashSet<>(namespaces.keySet());
    } finally {
      instanceLock.readLock().unlock();
    }
  }
79511
public ClusterConfigurationsInner withConfigurations(Map<String, Map<String, String>> configurations) {
        this.configurations = configurations;
        return this;
    }
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;
    }
11838
public WebServiceTemplateBuilder setFaultMessageResolver(
			FaultMessageResolver faultMessageResolver) {
		return new WebServiceTemplateBuilder(this.detectHttpMessageSender,
				this.interceptors,
				append(this.internalCustomizers,
						new FaultMessageResolverCustomizer(faultMessageResolver)),
				this.customizers, this.messageSenders, this.marshaller, this.unmarshaller,
				this.destinationProvider, this.transformerFactoryClass,
				this.messageFactory);
	}
969955
public static InvalidKBException validationErrors(List<String> errors){
        StringBuilder message = new StringBuilder();
        message.append(ErrorMessage.VALIDATION.getMessage(errors.size()));
        for (String s : errors) {
            message.append(s);
        }
        return create(message.toString());
    }
1018297
@SafeVarargs
    public static <K, V> Map<K, V> map(final Entry<? extends K, ? extends V>... entries) {
        final Map<K, V> map = new LinkedHashMap<K, V>(entries.length);
        for (final Entry<? extends K, ? extends V> entry : entries) {
            map.put(entry.getKey(), entry.getValue());
        }
        return map;
    }
289118
public List<String> getKeyspaces() {
        ArrayList<String> result = new ArrayList<String>();
        this.metadata = this.cluster.getMetadata();
        if (!(metadata.getKeyspaces().isEmpty())) {
            for (KeyspaceMetadata k : this.metadata.getKeyspaces()) {
                result.add(k.getName());
            }
        }
        return result;
    }
1021856
public Map<String, Namespace> getNamespaceMap() {
        final Map<String, Namespace> ret = new HashMap<String, Namespace>();
        if (namespaceGroup == null) {
            return ret;
        }

        final List<Namespace> namespaces = namespaceGroup.getNamespaces();
        if (hasItems(namespaces)) {
            for (final Namespace ns : namespaces)
                ret.put(ns.getPrefix(), ns);
        }

        final String defns = namespaceGroup.getDefaultResourceLocation();
        if (defns != null) {
            Namespace ns = new Namespace(DEFAULT_NAMESPACE_PREFIX, defns);
            ret.put(DEFAULT_NAMESPACE_PREFIX, ns);
        }

        return ret;
    }