當前位置: 首頁>>代碼示例>>Java>>正文


Java StringUtils.commaDelimitedListToSet方法代碼示例

本文整理匯總了Java中org.springframework.util.StringUtils.commaDelimitedListToSet方法的典型用法代碼示例。如果您正苦於以下問題:Java StringUtils.commaDelimitedListToSet方法的具體用法?Java StringUtils.commaDelimitedListToSet怎麽用?Java StringUtils.commaDelimitedListToSet使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.springframework.util.StringUtils的用法示例。


在下文中一共展示了StringUtils.commaDelimitedListToSet方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: convertToSet

import org.springframework.util.StringUtils; //導入方法依賴的package包/類
private Set<String> convertToSet(String tags) {
	Set<String> initialSet = StringUtils.commaDelimitedListToSet(tags);

	Set<String> setToReturn = initialSet.stream()
			.map(StringUtils::trimAllWhitespace)
			.collect(Collectors.toSet());

	return setToReturn;
}
 
開發者ID:spring-cloud,項目名稱:spring-cloud-skipper,代碼行數:10,代碼來源:PackageReaderTests.java

示例2: serviceRegistryCouchbaseClientFactory

import org.springframework.util.StringUtils; //導入方法依賴的package包/類
/**
 * Service registry couchbase client factory couchbase client factory.
 *
 * @return the couchbase client factory
 */
@RefreshScope
@Bean
public CouchbaseClientFactory serviceRegistryCouchbaseClientFactory() {
    final CouchbaseServiceRegistryProperties couchbase = casProperties.getServiceRegistry().getCouchbase();
    final Set<String> nodes = StringUtils.commaDelimitedListToSet(couchbase.getNodeSet());
    return new CouchbaseClientFactory(nodes, couchbase.getBucket(), couchbase.getPassword(), couchbase.getTimeout());
}
 
開發者ID:mrluo735,項目名稱:cas-5.1.0,代碼行數:13,代碼來源:CouchbaseServiceRegistryConfiguration.java

示例3: ticketRegistryCouchbaseClientFactory

import org.springframework.util.StringUtils; //導入方法依賴的package包/類
@RefreshScope
@Bean
public CouchbaseClientFactory ticketRegistryCouchbaseClientFactory() {
    final CouchbaseTicketRegistryProperties cb = casProperties.getTicket().getRegistry().getCouchbase();
    final Set<String> nodes = StringUtils.commaDelimitedListToSet(cb.getNodeSet());
    return new CouchbaseClientFactory(nodes, cb.getBucket(), cb.getPassword(), cb.getTimeout());
}
 
開發者ID:mrluo735,項目名稱:cas-5.1.0,代碼行數:8,代碼來源:CouchbaseTicketRegistryConfiguration.java

示例4: toStreamMetrics

import org.springframework.util.StringUtils; //導入方法依賴的package包/類
/**
 * Converts the plain model of {@link ApplicationMetrics} into a hierarchical
 * representation of {@link StreamMetrics}
 * @param filter Comma delimited list of stream names to be filtered on. If null or
 * empty all streams are returned
 * @return A collection of filtered {@link StreamMetrics}
 */
public Collection<StreamMetrics> toStreamMetrics(String filter) {
	Collection<StreamMetrics> entries = new LinkedList<>();
	Set<String> streamNames = null;
	try {
		this.rwLock.lock();
		if (StringUtils.isEmpty(filter)) {
			streamNames = storage.asMap().values().stream()
					.map(applicationMetrics -> String.valueOf(
							applicationMetrics.getFirst().getProperties().get(ApplicationMetrics.STREAM_NAME)))
					.collect(Collectors.toSet());
		}
		else {
			streamNames = StringUtils.commaDelimitedListToSet(filter);
		}

		for (String streamName : streamNames) {
			StreamMetrics streamMetrics = null;
			List<List<ApplicationMetrics>> filteredList = storage
					.asMap().values().stream().filter(applicationMetrics -> applicationMetrics.getFirst()
							.getProperties().get(ApplicationMetrics.STREAM_NAME).equals(streamName))
					.collect(Collectors.toList());
			for (List<ApplicationMetrics> applicationMetricsList : filteredList) {
				streamMetrics = convert(applicationMetricsList, streamMetrics);
			}
			if (streamMetrics != null) {
				entries.add(streamMetrics);
			}
		}
	}
	finally {
		this.rwLock.unlock();
	}
	return entries;
}
 
開發者ID:spring-cloud,項目名稱:spring-cloud-dataflow-metrics-collector,代碼行數:42,代碼來源:ApplicationMetricsService.java


注:本文中的org.springframework.util.StringUtils.commaDelimitedListToSet方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。