private static String nameOf()

in src/main/java/com/googlesource/gerrit/plugins/singleusergroup/SingleUserGroup.java [185:209]


  private static String nameOf(AccountGroup.UUID uuid, AccountState accountState) {
    StringBuilder buf = new StringBuilder();
    if (accountState.account().fullName() != null) {
      buf.append(accountState.account().fullName());
    }
    if (accountState.userName().isPresent()) {
      if (buf.length() > 0) {
        buf.append(" (").append(accountState.userName().get()).append(")");
      } else {
        buf.append(accountState.userName().get());
      }
    } else if (buf.length() > 0) {
      buf.append(" (").append(accountState.account().id().get()).append(")");
    } else {
      buf.append(accountState.account().id().get());
    }

    String ident = username(uuid);
    if (ident.matches(ACCOUNT_ID_PATTERN)) {
      buf.insert(0, ACCOUNT_PREFIX);
    } else {
      buf.insert(0, NAME_PREFIX);
    }
    return buf.toString();
  }