本文整理汇总了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;
}
示例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());
}
示例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());
}
示例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