public static List<RepositoryResponse> asResponses(List<RepositoryInfo> repositoryInfos,
                                                     @Nullable String versionDefinitionId,
                                                     @Nullable String stackName,
                                                     @Nullable String stackVersion) {
    List<RepositoryResponse> responses = new ArrayList<>(repositoryInfos.size());
    for (RepositoryInfo repoInfo: repositoryInfos) {
      RepositoryResponse response = repoInfo.convertToResponse();
      response.setVersionDefinitionId(versionDefinitionId);
      response.setStackName(stackName);
      response.setStackVersion(stackVersion);
      responses.add(response);
    }
    return responses;
  }
Convert a list of {@link RepositoryInfo} objects to a lost of {@link RepositoryResponse} objects
@param repositoryInfos the list of repository infos
@param versionDefinitionId the version definition id
@param stackName the stack name
@param stackVersion the stack version
@return a list of repository responses
ambari-server/src/main/java/org/apache/ambari/server/stack/RepoUtil.java