@@ -0,0 +1,1970 @@
+// Copyright (C) 2014 The Android Open Source Project%0A//%0A// Licensed under the Apache License, Version 2.0 (the %22License%22);%0A// you may not use this file except in compliance with the License.%0A// You may obtain a copy of the License at%0A//%0A// http://www.apache.org/licenses/LICENSE-2.0%0A//%0A// Unless required by applicable law or agreed to in writing, software%0A// distributed under the License is distributed on an %22AS IS%22 BASIS,%0A// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A// See the License for the specific language governing permissions and%0A// limitations under the License.%0A%0Apackage com.google.gerrit.server.edit;%0A%0Aimport static com.google.common.base.Preconditions.checkNotNull;%0A%0Aimport com.google.gerrit.reviewdb.client.Change;%0Aimport com.google.gerrit.reviewdb.client.RefNames;%0Aimport com.google.gerrit.reviewdb.client.RevId;%0Aimport com.google.gerrit.server.IdentifiedUser;%0A%0Aimport org.eclipse.jgit.lib.ObjectId;%0Aimport org.eclipse.jgit.lib.Ref;%0A%0A/**%0A * A single user's edit for a change.%0A * %3Cp%3E%0A * There is max. one edit per user per change. Edits are stored on refs:%0A * refs/users/UU/UUUU/edit-CCCC where UU/UUUU is sharded representation%0A * of user account and CCCC is change number.%0A */%0Apublic class ChangeEdit %7B%0A  private final IdentifiedUser user;%0A  private final Change change;%0A  private final Ref ref;%0A%0A  public ChangeEdit(IdentifiedUser user, Change change, Ref ref) %7B%0A    checkNotNull(user);%0A    checkNotNull(change);%0A    checkNotNull(ref);%0A    this.user = user;%0A    this.change = change;%0A    this.ref = ref;%0A  %7D%0A%0A  public Change getChange() %7B%0A    return change;%0A  %7D%0A%0A  public IdentifiedUser getUser() %7B%0A    return user;%0A  %7D%0A%0A  public Ref getRef() %7B%0A    return ref;%0A  %7D%0A%0A  public RevId getRevision() %7B%0A    return new RevId(ObjectId.toString(ref.getObjectId()));%0A  %7D%0A%0A  public String getRefName() %7B%0A    return String.format(%22%25s/edit-%25d%22,%0A        RefNames.refsUsers(user.getAccountId()),%0A        change.getId().get());%0A  %7D%0A%7D%0A

Add container to represent change edit