Class ChangeEditApi.NotImplemented

java.lang.Object
com.google.gerrit.extensions.api.changes.ChangeEditApi.NotImplemented
All Implemented Interfaces:
ChangeEditApi
Enclosing interface:
ChangeEditApi

public static class ChangeEditApi.NotImplemented extends Object implements ChangeEditApi
A default implementation which allows source compatibility when adding new methods to the interface.
  • Constructor Details

    • NotImplemented

      public NotImplemented()
  • Method Details

    • detail

      Specified by:
      detail in interface ChangeEditApi
      Throws:
      RestApiException
    • get

      public Optional<EditInfo> get() throws RestApiException
      Description copied from interface: ChangeEditApi
      Retrieves details regarding the change edit.
      Specified by:
      get in interface ChangeEditApi
      Returns:
      an Optional containing details about the change edit if it exists, or Optional.empty()
      Throws:
      RestApiException - if the change edit couldn't be retrieved
    • create

      public void create() throws RestApiException
      Description copied from interface: ChangeEditApi
      Creates a new change edit. It has exactly the same Git tree as the current patch set of the change.
      Specified by:
      create in interface ChangeEditApi
      Throws:
      RestApiException - if the change edit couldn't be created or a change edit already exists
    • delete

      public void delete() throws RestApiException
      Description copied from interface: ChangeEditApi
      Deletes the change edit.
      Specified by:
      delete in interface ChangeEditApi
      Throws:
      RestApiException - if the change edit couldn't be deleted or a change edit wasn't present
    • rebase

      public void rebase() throws RestApiException
      Description copied from interface: ChangeEditApi
      Rebases the change edit on top of the latest patch set of this change.
      Specified by:
      rebase in interface ChangeEditApi
      Throws:
      RestApiException - if the change edit couldn't be rebased or a change edit wasn't present
    • rebase

      public EditInfo rebase(RebaseChangeEditInput input) throws RestApiException
      Description copied from interface: ChangeEditApi
      Rebases the change edit on top of the latest patch set of this change.
      Specified by:
      rebase in interface ChangeEditApi
      Parameters:
      input - params for rebasing the change edit
      Throws:
      RestApiException - if the change edit couldn't be rebased or a change edit wasn't present
    • publish

      public void publish() throws RestApiException
      Description copied from interface: ChangeEditApi
      Publishes the change edit using default settings. See ChangeEditApi.publish(PublishChangeEditInput) for more details.
      Specified by:
      publish in interface ChangeEditApi
      Throws:
      RestApiException - if the change edit couldn't be published or a change edit wasn't present
    • publish

      public void publish(PublishChangeEditInput publishChangeEditInput) throws RestApiException
      Description copied from interface: ChangeEditApi
      Publishes the change edit. Publishing means that the change edit is turned into a regular patch set of the change.
      Specified by:
      publish in interface ChangeEditApi
      Parameters:
      publishChangeEditInput - a PublishChangeEditInput specifying the options which should be applied
      Throws:
      RestApiException - if the change edit couldn't be published or a change edit wasn't present
    • getFile

      public Optional<BinaryResult> getFile(String filePath) throws RestApiException
      Description copied from interface: ChangeEditApi
      Retrieves the contents of the specified file from the change edit.
      Specified by:
      getFile in interface ChangeEditApi
      Parameters:
      filePath - the path of the file
      Returns:
      an Optional containing the contents of the file as a BinaryResult if the file exists within the change edit, or Optional.empty()
      Throws:
      RestApiException - if the contents of the file couldn't be retrieved or a change edit wasn't present
    • renameFile

      public void renameFile(String oldFilePath, String newFilePath) throws RestApiException
      Description copied from interface: ChangeEditApi
      Renames a file of the change edit or moves the file to another directory. If the change edit doesn't exist, it will be created based on the current patch set of the change.
      Specified by:
      renameFile in interface ChangeEditApi
      Parameters:
      oldFilePath - the current file path
      newFilePath - the desired file path
      Throws:
      RestApiException - if the file couldn't be renamed
    • restoreFile

      public void restoreFile(String filePath) throws RestApiException
      Description copied from interface: ChangeEditApi
      Restores a file of the change edit to the state in which it was before the patch set on which the change edit is based. This includes the file content as well as the existence or non-existence of the file. If the change edit doesn't exist, it will be created based on the current patch set of the change.
      Specified by:
      restoreFile in interface ChangeEditApi
      Parameters:
      filePath - the path of the file
      Throws:
      RestApiException - if the file couldn't be restored to its previous state
    • modifyFile

      public void modifyFile(String filePath, FileContentInput input) throws RestApiException
      Description copied from interface: ChangeEditApi
      Modify the contents of the specified file of the change edit. If no content is provided, the content of the file is erased but the file isn't deleted. If the change edit doesn't exist, it will be created based on the current patch set of the change.
      Specified by:
      modifyFile in interface ChangeEditApi
      Parameters:
      filePath - the path of the file which should be modified
      input - the desired content of the file
      Throws:
      RestApiException - if the content of the file couldn't be modified
    • deleteFile

      public void deleteFile(String filePath) throws RestApiException
      Description copied from interface: ChangeEditApi
      Deletes the specified file from the change edit. If the change edit doesn't exist, it will be created based on the current patch set of the change.
      Specified by:
      deleteFile in interface ChangeEditApi
      Parameters:
      filePath - the path fo the file which should be deleted
      Throws:
      RestApiException - if the file couldn't be deleted
    • getCommitMessage

      public String getCommitMessage() throws RestApiException
      Description copied from interface: ChangeEditApi
      Retrieves the commit message of the change edit.
      Specified by:
      getCommitMessage in interface ChangeEditApi
      Returns:
      the commit message of the change edit
      Throws:
      RestApiException - if the commit message couldn't be retrieved or a change edit wasn't present
    • modifyCommitMessage

      public void modifyCommitMessage(String newCommitMessage) throws RestApiException
      Description copied from interface: ChangeEditApi
      Modifies the commit message of the change edit. If the change edit doesn't exist, it will be created based on the current patch set of the change.
      Specified by:
      modifyCommitMessage in interface ChangeEditApi
      Parameters:
      newCommitMessage - the desired commit message
      Throws:
      RestApiException - if the commit message couldn't be modified
    • modifyIdentity

      public void modifyIdentity(String name, String email, ChangeEditIdentityType type) throws RestApiException
      Description copied from interface: ChangeEditApi
      Updates the author/committer of the change edit. If the change edit doesn't exist, it will be created based on the current patch set of the change.
      Specified by:
      modifyIdentity in interface ChangeEditApi
      Parameters:
      name - the name of the author/committer
      email - the email of the author/committer
      type - the type of the identity being edited
      Throws:
      RestApiException - if the author/committer identity couldn't be updated