io.fabric8.utils.Strings.splitAndTrimAsList()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(3.5k)|赞(0)|评价(0)|浏览(98)

本文整理了Java中io.fabric8.utils.Strings.splitAndTrimAsList()方法的一些代码示例,展示了Strings.splitAndTrimAsList()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Strings.splitAndTrimAsList()方法的具体详情如下:
包路径:io.fabric8.utils.Strings
类名称:Strings
方法名:splitAndTrimAsList

Strings.splitAndTrimAsList介绍

[英]splits a string into a list of strings. Trims the results and ignores empty strings
[中]将字符串拆分为字符串列表。修剪结果并忽略空字符串

代码示例

代码示例来源:origin: io.fabric8/arquillian-fabric8

/**
 * Applies the kubernetes json url to the configuration.
 * @param configuration The target configuration object.
 * @param map           The arquillian configuration.
 */
private static void applyDependencies(Configuration configuration, Map<String, String> map) throws MalformedURLException {
  if (map.containsKey(DEPENDENCIES)) {
    configuration.dependencies = Strings.splitAndTrimAsList(map.get(DEPENDENCIES), " ");
  }
}

代码示例来源:origin: io.fabric8/fabric8-arquillian

private static void configureProtocolHandlers(Map<String, String> conf) {
    Set<String> handlers = new LinkedHashSet<>();
    handlers.addAll(Strings.splitAndTrimAsList(System.getProperty(JAVA_PROTOCOL_HANDLER, ""), " "));
    handlers.addAll(Strings.splitAndTrimAsList(conf.containsKey(PROTOCOL_HANDLERS) ? conf.get(PROTOCOL_HANDLERS) : DEFAULT_MAVEN_PROTOCOL_HANDLER, " "));
    System.setProperty(JAVA_PROTOCOL_HANDLER, Strings.join(handlers, " "));
  }
}

代码示例来源:origin: io.fabric8/arquillian-fabric8

private static void configureProtocolHandlers(Map<String, String> conf) {
    Set<String> handlers = new LinkedHashSet<>();
    handlers.addAll(Strings.splitAndTrimAsList(System.getProperty(JAVA_PROTOCOL_HANDLER, ""), " "));
    handlers.addAll(Strings.splitAndTrimAsList(conf.containsKey(PROTOCOL_HANDLERS) ? conf.get(PROTOCOL_HANDLERS) : DEFAULT_MAVEN_PROTOCOL_HANDLER, " "));
    System.setProperty(JAVA_PROTOCOL_HANDLER, Strings.join(handlers, " "));
  }
}

代码示例来源:origin: io.fabric8/arquillian-fabric8

public static Configuration fromMap(Map<String, String> map) {
  Configuration configuration = new Configuration();
  try {
    applyMasterUrl(configuration, map);
    applyConfigurationURL(configuration, map);
    applyDependencies(configuration, map);
    configuration.timeout = getLongProperty(TIMEOUT, map, DEFAULT_TIMEOUT);
    configuration.pollInterval = getLongProperty(POLL_INTERVAL, map, DEFAULT_POLL_INTERVAL);
    configuration.ansiLoggerEnabled = getBooleanProperty(ANSI_LOGGER_ENABLED, map, true);
    configuration.waitForServiceConnection = getBooleanProperty(WAIT_FOR_SERVICE_CONNECTION, map, true);
    configuration.waitForServices = Strings.splitAndTrimAsList(getStringProperty(WAIT_FOR_SERVICES, map, ""), " ");
    configuration.serviceConnectionTimeout = getLongProperty(SERVICE_CONNECTION_TIMEOUT, map, DEFAULT_SERVICE_CONNECTION_TIMEOUT);
  } catch (Throwable t) {
    throw new RuntimeException(t);
  }
  return configuration;
}

代码示例来源:origin: io.fabric8/fabric8-arquillian

configuration.environmentInitEnabled = getBooleanProperty(ENVIRONMENT_INIT_ENABLED, map, true);
configuration.environmentConfigUrl = getKubernetesConfigurationUrl(map);
configuration.environmentDependencies = Strings.splitAndTrimAsList(getStringProperty(ENVIRONMENT_DEPENDENCIES, map, ""), "\\s+");
configuration.waitForServiceList = Strings.splitAndTrimAsList(getStringProperty(WAIT_FOR_SERVICE_LIST, map, ""), "\\s+");
configuration.waitForServiceConnectionEnabled = getBooleanProperty(WAIT_FOR_SERVICE_CONNECTION_ENABLED, map, DEFAULT_WAIT_FOR_SERVICE_CONNECTION_ENABLED);
configuration.waitForServiceConnectionTimeout = getLongProperty(WAIT_FOR_SERVICE_CONNECTION_TIMEOUT, map, DEFAULT_NAMESPACE_CLEANUP_TIMEOUT);

相关文章