class CompletionMetadataUtils {

  @VisibleForTesting
  static String addressGroupDisplayString(
      Configuration configuration, String bookName, String groupName) {
    String suffix =
        configuration.getHumanName() == null
            ? ""
            : String.format(" (%s)", configuration.getHumanName());
    if (bookName.equals(
        GeneratedRefBookUtils.getName(configuration.getHostname(), BookType.PoolAddresses))) {
      return String.format(
          "Pool address %s on %s%s", groupName, configuration.getHostname(), suffix);
    }
    if (bookName.equals(
        GeneratedRefBookUtils.getName(configuration.getHostname(), BookType.VirtualAddresses))) {
      return String.format(
          "Virtual address %s on %s%s", groupName, configuration.getHostname(), suffix);
    }
    if (bookName.equals(
        GeneratedRefBookUtils.getName(configuration.getHostname(), BookType.PublicIps))) {
      return String.format("%s public IP%s", configuration.getHostname(), suffix);
    }
    if (bookName.equals(
        GeneratedRefBookUtils.getName(configuration.getHostname(), BookType.AwsSeviceIps))) {
      return groupName;
    }
    // Don't know what type of address this is; use default value.
    return String.format(
        "%s in %s on %s%s", groupName, bookName, configuration.getHostname(), suffix);
  }

  private  CompletionMetadataUtils();

}