protected String getStageText(String prefix, String component, Set<String> hosts, int batchNum, int totalBatches) {
    String stageText = getStageText(prefix, component, hosts);
    String batchText = 1 == totalBatches? "" : String.format(" (Batch %s of %s)", batchNum, totalBatches);
    return stageText + batchText;
  }
Consistently formats a string.
@param prefix
@param component
@param batchNum
@param totalBatches
@return the prepared string
ambari-server/src/main/java/org/apache/ambari/server/stack/upgrade/orchestrate/StageWrapperBuilder.java