Interface ChangeEmail

All Superinterfaces:
OutgoingEmail.EmailDecorator
All Known Implementing Classes:
ChangeEmailImpl

public interface ChangeEmail extends OutgoingEmail.EmailDecorator
Populates an email for change related notifications.
  • Method Details

    • markAsReply

      void markAsReply()
      Mark the email as non-first in the thread to ensure correct headers will be set
    • getChange

      Change getChange()
      Get change for which the email is being sent.
    • getChangeData

      ChangeData getChangeData()
      Get ChangeData for the change corresponding to the email.
    • getTimestamp

      Instant getTimestamp()
      Get Timestamp of the event causing the email.

      Provided by setChangeMessage(String, Instant).

    • setPatchSet

      void setPatchSet(PatchSet ps)
      Specify PatchSet with which the notification is associated with.
    • getPatchSet

      PatchSet getPatchSet()
      Get PatchSet if provided.
    • setPatchSet

      void setPatchSet(PatchSet ps, PatchSetInfo psi)
      Specify PatchSet along with additional data.
    • setChangeMessage

      void setChangeMessage(String cm, Instant t)
      Specify the summary of what happened to the change.
    • setEmailOnlyAttentionSetIfEnabled

      void setEmailOnlyAttentionSetIfEnabled(boolean value)
      Specify if the email should only be sent to attention set.

      Only affects users who have corresponding option enabled in the settings.

    • getCoverLetter

      String getCoverLetter()
      Get the text of the "cover letter" (processed changeMessage).
    • listModifiedFiles

      Map<String,FileDiffOutput> listModifiedFiles(int patchSetId)
      Get the patch list corresponding to patch set patchSetId of this change.
    • listModifiedFiles

      Map<String,FileDiffOutput> listModifiedFiles()
      Get the patch list corresponding to this patch set.
    • getInsertionsCount

      int getInsertionsCount()
      Get the number of added lines in a change.
    • getDeletionsCount

      int getDeletionsCount()
      Get the number of deleted lines in a change.
    • getProjectState

      ProjectState getProjectState()
      Get the project entity the change is in; null if its been deleted.
    • addAuthors

      void addAuthors(RecipientType rt)
      TO or CC all vested parties (change owner, patch set uploader, author).
    • bccStarredBy

      void bccStarredBy()
      BCC any user who has starred this change.
    • includeWatchers

      void includeWatchers(NotifyConfig.NotifyType type)
      Include users and groups that want notification of events.
    • includeWatchers

      void includeWatchers(NotifyConfig.NotifyType type, boolean includeWatchersFromNotifyConfig)
      Include users and groups that want notification of events.
    • ccAllApprovals

      void ccAllApprovals()
      Any user who has published comments on this change.
    • ccExistingReviewers

      void ccExistingReviewers()
      Users who were added as reviewers to this change.
    • getUnifiedDiff

      String getUnifiedDiff()
      Show patch set as unified difference.
    • getDiffTemplateData

      static com.google.common.collect.ImmutableList<com.google.common.collect.ImmutableMap<String,String>> getDiffTemplateData(String sourceDiff)
      Generate a list of maps representing each line of the unified diff. The line maps will have a 'type' key which maps to one of 'common', 'add' or 'remove' and a 'text' key which maps to the line's content.
      Parameters:
      sourceDiff - the unified diff that we're converting to the map.
      Returns:
      map of 'type' to a line's content.