use of com.google.gerrit.server.data.RefUpdateAttribute in project gerrit by GerritCodeReview.
the class EventFactory method asRefUpdateAttribute.
/**
* Create a {@link RefUpdateAttribute} for the given old ObjectId, new ObjectId, and branch that
* is suitable for serialization to JSON.
*/
public RefUpdateAttribute asRefUpdateAttribute(ObjectId oldId, ObjectId newId, BranchNameKey refName) {
RefUpdateAttribute ru = new RefUpdateAttribute();
ru.newRev = newId != null ? newId.getName() : ObjectId.zeroId().getName();
ru.oldRev = oldId != null ? oldId.getName() : ObjectId.zeroId().getName();
ru.project = refName.project().get();
ru.refName = refName.branch();
return ru;
}
Aggregations