public class ChangeEditUtil extends Object
This class contains methods to retrieve, publish and delete edits.
For changing edits see ChangeEditModifier
.
Modifier and Type | Method and Description |
---|---|
com.google.common.base.Optional<ChangeEdit> |
byChange(com.google.gerrit.reviewdb.client.Change change)
Retrieve edit for a change and the user from the request scope.
|
com.google.common.base.Optional<ChangeEdit> |
byChange(ChangeControl ctl)
Retrieve edit for a change and the given user.
|
void |
delete(ChangeEdit edit)
Delete change edit.
|
void |
publish(ChangeEdit edit)
Promote change edit to patch set, by squashing the edit into
its parent.
|
public com.google.common.base.Optional<ChangeEdit> byChange(com.google.gerrit.reviewdb.client.Change change) throws com.google.gerrit.extensions.restapi.AuthException, IOException, com.google.gwtorm.server.OrmException
At most one change edit can exist per user and change.
change
- com.google.gerrit.extensions.restapi.AuthException
IOException
com.google.gwtorm.server.OrmException
public com.google.common.base.Optional<ChangeEdit> byChange(ChangeControl ctl) throws com.google.gerrit.extensions.restapi.AuthException, IOException
At most one change edit can exist per user and change.
ctl
- control with user to retrieve change edits for.com.google.gerrit.extensions.restapi.AuthException
- if this is not a logged-in user.IOException
- if an error occurs.public void publish(ChangeEdit edit) throws NoSuchChangeException, IOException, com.google.gwtorm.server.OrmException, com.google.gerrit.extensions.restapi.RestApiException, UpdateException
edit
- change edit to publishNoSuchChangeException
IOException
com.google.gwtorm.server.OrmException
UpdateException
com.google.gerrit.extensions.restapi.RestApiException
public void delete(ChangeEdit edit) throws IOException, com.google.gwtorm.server.OrmException
edit
- change edit to deleteIOException
com.google.gwtorm.server.OrmException