當前位置: 首頁>>代碼示例>>Java>>正文


Java PatchSetApproval.getAccountId方法代碼示例

本文整理匯總了Java中com.google.gerrit.reviewdb.client.PatchSetApproval.getAccountId方法的典型用法代碼示例。如果您正苦於以下問題:Java PatchSetApproval.getAccountId方法的具體用法?Java PatchSetApproval.getAccountId怎麽用?Java PatchSetApproval.getAccountId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.google.gerrit.reviewdb.client.PatchSetApproval的用法示例。


在下文中一共展示了PatchSetApproval.getAccountId方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: fromApprovals

import com.google.gerrit.reviewdb.client.PatchSetApproval; //導入方法依賴的package包/類
public static ReviewerSet fromApprovals(Iterable<PatchSetApproval> approvals) {
  PatchSetApproval first = null;
  Table<ReviewerStateInternal, Account.Id, Timestamp> reviewers = HashBasedTable.create();
  for (PatchSetApproval psa : approvals) {
    if (first == null) {
      first = psa;
    } else {
      checkArgument(
          first
              .getKey()
              .getParentKey()
              .getParentKey()
              .equals(psa.getKey().getParentKey().getParentKey()),
          "multiple change IDs: %s, %s",
          first.getKey(),
          psa.getKey());
    }
    Account.Id id = psa.getAccountId();
    reviewers.put(REVIEWER, id, psa.getGranted());
    if (psa.getValue() != 0) {
      reviewers.remove(CC, id);
    }
  }
  return new ReviewerSet(reviewers);
}
 
開發者ID:gerrit-review,項目名稱:gerrit,代碼行數:26,代碼來源:ReviewerSet.java

示例2: baseRankingForEmptyQuery

import com.google.gerrit.reviewdb.client.PatchSetApproval; //導入方法依賴的package包/類
private Map<Account.Id, MutableDouble> baseRankingForEmptyQuery(double baseWeight)
    throws OrmException, IOException, ConfigInvalidException {
  // Get the user's last 25 changes, check approvals
  try {
    List<ChangeData> result =
        queryProvider
            .get()
            .setLimit(25)
            .setRequestedFields(ChangeField.APPROVAL)
            .query(changeQueryBuilder.owner("self"));
    Map<Account.Id, MutableDouble> suggestions = new HashMap<>();
    for (ChangeData cd : result) {
      for (PatchSetApproval approval : cd.currentApprovals()) {
        Account.Id id = approval.getAccountId();
        if (suggestions.containsKey(id)) {
          suggestions.get(id).add(baseWeight);
        } else {
          suggestions.put(id, new MutableDouble(baseWeight));
        }
      }
    }
    return suggestions;
  } catch (QueryParseException e) {
    // Unhandled, because owner:self will never provoke a QueryParseException
    log.error("Exception while suggesting reviewers", e);
    return ImmutableMap.of();
  }
}
 
開發者ID:gerrit-review,項目名稱:gerrit,代碼行數:29,代碼來源:ReviewerRecommender.java

示例3: ApprovalEvent

import com.google.gerrit.reviewdb.client.PatchSetApproval; //導入方法依賴的package包/類
ApprovalEvent(PatchSetApproval psa, Timestamp changeCreatedOn) {
  super(
      psa.getPatchSetId(),
      psa.getAccountId(),
      psa.getRealAccountId(),
      psa.getGranted(),
      changeCreatedOn,
      psa.getTag());
  this.psa = psa;
}
 
開發者ID:gerrit-review,項目名稱:gerrit,代碼行數:11,代碼來源:ApprovalEvent.java

示例4: labelsForUnsubmittedChange

import com.google.gerrit.reviewdb.client.PatchSetApproval; //導入方法依賴的package包/類
private Map<String, LabelWithStatus> labelsForUnsubmittedChange(
    PermissionBackend.ForChange perm,
    ChangeData cd,
    LabelTypes labelTypes,
    boolean standard,
    boolean detailed)
    throws OrmException, PermissionBackendException {
  Map<String, LabelWithStatus> labels = initLabels(cd, labelTypes, standard);
  if (detailed) {
    setAllApprovals(perm, cd, labels);
  }
  for (Map.Entry<String, LabelWithStatus> e : labels.entrySet()) {
    LabelType type = labelTypes.byLabel(e.getKey());
    if (type == null) {
      continue;
    }
    if (standard) {
      for (PatchSetApproval psa : cd.currentApprovals()) {
        if (type.matches(psa)) {
          short val = psa.getValue();
          Account.Id accountId = psa.getAccountId();
          setLabelScores(type, e.getValue(), val, accountId);
        }
      }
    }
    if (detailed) {
      setLabelValues(type, e.getValue());
    }
  }
  return labels;
}
 
開發者ID:gerrit-review,項目名稱:gerrit,代碼行數:32,代碼來源:ChangeJson.java


注:本文中的com.google.gerrit.reviewdb.client.PatchSetApproval.getAccountId方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。