Java Code Examples for org.apache.logging.log4j.util.Strings#join()

The following examples show how to use org.apache.logging.log4j.util.Strings#join() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RatisNameRewriteSampleBuilder.java    From hadoop-ozone with Apache License 2.0 5 votes vote down vote up
protected String normalizeRatisMetric(String dropwizardName,
    List<String> names,
    List<String> values) {

  List<String> nameParts =
      new ArrayList<>(Arrays.asList(dropwizardName.split("\\.")));
  //second part is id or id@group_id
  if (nameParts.size() > 2) {
    String[] identifiers = nameParts.get(2).split("@");
    names.add("instance");
    values.add(identifiers[0]);
    if (identifiers.length > 1) {
      names.add("group");
      values.add(identifiers[1]);
    }
    nameParts.remove(2);
  }

  if (nameParts.size() > 2) {
    for (Pattern pattern : followerPatterns) {
      Matcher matcher = pattern.matcher(nameParts.get(2));
      if (matcher.matches()) {
        names.add("follower");
        String followerId = matcher.group(1);
        values.add(followerId);
        nameParts.set(2, nameParts.get(2).replace(followerId + "_", ""));
      }
    }
  }
  return Strings.join(nameParts, '.');
}
 
Example 2
Source File: Singer.java    From spring-cloud-gcp with Apache License 2.0 5 votes vote down vote up
@Override
public String toString() {
	return "Singer{" + "singerId='" + this.singerId + '\'' + ", firstName='"
			+ this.firstName + '\'' + ", lastName='" + this.lastName + '\''
			+ ", albums=" + this.albums + ", firstBand=" + this.firstBand + ", bands="
			+ ((this.bands == null) ? ""
					: Strings.join(this.bands.stream().map((x) -> x.getName())
							.collect(Collectors.toList()), ','))
			+ ", personalInstruments="
			+ ((this.personalInstruments == null) ? ""
					: Strings.join(this.personalInstruments.stream()
							.map((x) -> x.getType()).collect(Collectors.toList()), ','))
			+ '}';
}
 
Example 3
Source File: UnknownLookupAttributesException.java    From molgenis with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
protected Object[] getLocalizedMessageArguments() {
  return new Object[] {entityTypeId, Strings.join(attributeIds, ',')};
}