org.elasticsearch.common.Strings.split()方法的使用及代码示例

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

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

Strings.split介绍

[英]Split a String at the first occurrence of the delimiter. Does not include the delimiter in the result.
[中]在第一次出现分隔符时拆分字符串。不在结果中包含分隔符。

代码示例

代码示例来源:origin: org.elasticsearch/elasticsearch

public TaskId(String taskId) {
  if (Strings.hasLength(taskId) && "unset".equals(taskId) == false) {
    String[] s = Strings.split(taskId, ":");
    if (s == null || s.length != 2) {
      throw new IllegalArgumentException("malformed task id " + taskId);
    }
    this.nodeId = s[0];
    try {
      this.id = Long.parseLong(s[1]);
    } catch (NumberFormatException ex) {
      throw new IllegalArgumentException("malformed task id " + taskId, ex);
    }
  } else {
    nodeId = "";
    id = -1L;
  }
}

代码示例来源:origin: org.elasticsearch/elasticsearch

String[] s1 = Strings.splitStringByCommaToArray(source[i].toString());
  for (String s : s1) {
    String[] s2 = Strings.split(s, "=");
    if (s2.length != 2) {
      throw new IllegalArgumentException("malformed " + s);
String[] s1 = Strings.splitStringByCommaToArray(source[i].toString());
for (String s : s1) {
  String[] s2 = Strings.split(s, "=");
  if (s2.length != 2) {
    throw new IllegalArgumentException("malformed " + s);

代码示例来源:origin: harbby/presto-connectors

String[] s1 = Strings.splitStringByCommaToArray(source[i].toString());
  for (String s : s1) {
    String[] s2 = Strings.split(s, "=");
    if (s2.length != 2) {
      throw new IllegalArgumentException("malformed " + s);
String[] s1 = Strings.splitStringByCommaToArray(source[i].toString());
for (String s : s1) {
  String[] s2 = Strings.split(s, "=");
  if (s2.length != 2) {
    throw new IllegalArgumentException("malformed " + s);

代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch

public TaskId(String taskId) {
  if (Strings.hasLength(taskId) && "unset".equals(taskId) == false) {
    String[] s = Strings.split(taskId, ":");
    if (s == null || s.length != 2) {
      throw new IllegalArgumentException("malformed task id " + taskId);
    }
    this.nodeId = s[0];
    try {
      this.id = Long.parseLong(s[1]);
    } catch (NumberFormatException ex) {
      throw new IllegalArgumentException("malformed task id " + taskId, ex);
    }
  } else {
    nodeId = "";
    id = -1L;
  }
}

代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch

String[] s1 = Strings.splitStringByCommaToArray(source[i].toString());
  for (String s : s1) {
    String[] s2 = Strings.split(s, "=");
    if (s2.length != 2) {
      throw new IllegalArgumentException("malformed " + s);
String[] s1 = Strings.splitStringByCommaToArray(source[i].toString());
for (String s : s1) {
  String[] s2 = Strings.split(s, "=");
  if (s2.length != 2) {
    throw new IllegalArgumentException("malformed " + s);

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

public TaskId(String taskId) {
  if (Strings.hasLength(taskId) && "unset".equals(taskId) == false) {
    String[] s = Strings.split(taskId, ":");
    if (s == null || s.length != 2) {
      throw new IllegalArgumentException("malformed task id " + taskId);
    }
    this.nodeId = s[0];
    try {
      this.id = Long.parseLong(s[1]);
    } catch (NumberFormatException ex) {
      throw new IllegalArgumentException("malformed task id " + taskId, ex);
    }
  } else {
    nodeId = "";
    id = -1L;
  }
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

String[] s1 = Strings.splitStringByCommaToArray(source[i].toString());
  for (String s : s1) {
    String[] s2 = Strings.split(s, "=");
    if (s2.length != 2) {
      throw new IllegalArgumentException("malformed " + s);
String[] s1 = Strings.splitStringByCommaToArray(source[i].toString());
for (String s : s1) {
  String[] s2 = Strings.split(s, "=");
  if (s2.length != 2) {
    throw new IllegalArgumentException("malformed " + s);

代码示例来源:origin: apache/servicemix-bundles

public TaskId(String taskId) {
  if (Strings.hasLength(taskId) && "unset".equals(taskId) == false) {
    String[] s = Strings.split(taskId, ":");
    if (s == null || s.length != 2) {
      throw new IllegalArgumentException("malformed task id " + taskId);
    }
    this.nodeId = s[0];
    try {
      this.id = Long.parseLong(s[1]);
    } catch (NumberFormatException ex) {
      throw new IllegalArgumentException("malformed task id " + taskId, ex);
    }
  } else {
    nodeId = "";
    id = -1L;
  }
}

代码示例来源:origin: apache/servicemix-bundles

String[] s1 = Strings.splitStringByCommaToArray(source[i].toString());
  for (String s : s1) {
    String[] s2 = Strings.split(s, "=");
    if (s2.length != 2) {
      throw new IllegalArgumentException("malformed " + s);
String[] s1 = Strings.splitStringByCommaToArray(source[i].toString());
for (String s : s1) {
  String[] s2 = Strings.split(s, "=");
  if (s2.length != 2) {
    throw new IllegalArgumentException("malformed " + s);

代码示例来源:origin: harbby/presto-connectors

public TaskId(String taskId) {
  if (Strings.hasLength(taskId) && "unset".equals(taskId) == false) {
    String[] s = Strings.split(taskId, ":");
    if (s == null || s.length != 2) {
      throw new IllegalArgumentException("malformed task id " + taskId);
    }
    this.nodeId = s[0];
    try {
      this.id = Long.parseLong(s[1]);
    } catch (NumberFormatException ex) {
      throw new IllegalArgumentException("malformed task id " + taskId, ex);
    }
  } else {
    nodeId = "";
    id = -1L;
  }
}

代码示例来源:origin: harbby/presto-connectors

element = deleteAny(element, charsToDelete);
String[] splittedElement = split(element, delimiter);
if (splittedElement == null) {
  continue;

相关文章

微信公众号

最新文章

更多