Search in sources :

Example 1 with WebLinkInfoCommon

use of com.google.gerrit.common.data.WebLinkInfoCommon in project gerrit by GerritCodeReview.

the class WebLinks method getFileHistoryLinks.

/**
   * @param project Project name.
   * @param revision SHA1 of revision.
   * @param file File name.
   * @return Links for file history
   */
public List<WebLinkInfoCommon> getFileHistoryLinks(String project, String revision, String file) {
    return FluentIterable.from(fileHistoryLinks).transform(webLink -> {
        WebLinkInfo info = webLink.getFileHistoryWebLink(project, revision, file);
        if (info == null) {
            return null;
        }
        WebLinkInfoCommon commonInfo = new WebLinkInfoCommon();
        commonInfo.name = info.name;
        commonInfo.imageUrl = info.imageUrl;
        commonInfo.url = info.url;
        commonInfo.target = info.target;
        return commonInfo;
    }).filter(INVALID_WEBLINK_COMMON).toList();
}
Also used : WebLinkInfo(com.google.gerrit.extensions.common.WebLinkInfo) DiffWebLinkInfo(com.google.gerrit.extensions.common.DiffWebLinkInfo) WebLinkInfoCommon(com.google.gerrit.common.data.WebLinkInfoCommon)

Aggregations

WebLinkInfoCommon (com.google.gerrit.common.data.WebLinkInfoCommon)1 DiffWebLinkInfo (com.google.gerrit.extensions.common.DiffWebLinkInfo)1 WebLinkInfo (com.google.gerrit.extensions.common.WebLinkInfo)1