当前位置: 首页>>代码示例>>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;未经允许,请勿转载。