本文整理汇总了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);
}
示例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();
}
}
示例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;
}
示例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;
}