java.lang.Object
java.util.EventObject
org.springframework.context.ApplicationEvent
com.atlassian.confluence.event.events.ConfluenceEvent
com.atlassian.confluence.event.events.content.ContentEvent
com.atlassian.confluence.event.events.content.attachment.AttachmentEvent
All Implemented Interfaces:
Contented, Timestamped, Serializable
Direct Known Subclasses:
AttachmentTrashedEvent, AttachmentViewEvent, GeneralAttachmentBatchUploadCompletedEvent, GeneralAttachmentCreateEvent, GeneralAttachmentRemoveEvent, GeneralAttachmentRestoreEvent, GeneralAttachmentUpdateEvent, GeneralAttachmentVersionRemoveEvent

public abstract class AttachmentEvent extends ContentEvent
Parent class for all attachment related events.
See Also:
  • Constructor Details

    • AttachmentEvent

      protected AttachmentEvent(Object src, List<Attachment> attachments, boolean suppressNotifications)
      Constructs a multi-attachment event. All attachments in the list must have the same container.
      Parameters:
      src - the object publishing the event
      attachments - the list of attachments that this event is about
      suppressNotifications - whether or not to trigger notifications (e.g. emails to users watching the page)
    • AttachmentEvent

      protected AttachmentEvent(Object src, List<Attachment> attachments)
      Convenience method. Equivalent to calling new AttachmentEvent(src, attachments, false)
      See Also:
    • AttachmentEvent

      protected AttachmentEvent(Object src, Attachment attachment)
      Convenience method. Equivalent to calling new AttachmentEvent(src, Collections.singletonList(attachment), false)
      See Also:
    • AttachmentEvent

      protected AttachmentEvent(Object src, Attachment attachment, boolean suppressNotifications)
      Convenience method. Equivalent to calling new AttachmentEvent(src, Collections.singletonList(attachment), suppressNotifications)
      See Also:
  • Method Details

    • getContent

      public @NonNull ContentEntityObject getContent()
    • getAttachedTo

      public @NonNull ContentEntityObject getAttachedTo()
    • getAttachment

      public Attachment getAttachment()
      Returns the real content (the first attachment of the list or null if there is none)
      See Also:
    • getAttachments

      public @NonNull List<Attachment> getAttachments()
    • equals

      public boolean equals(@Nullable Object o)
      Description copied from class: ConfluenceEvent
      Equals for ConfluenceEvents is defined such that specific sub-events are only equal to events of the same type. It is incorrect to try to make an instance of a subclass equal to an instance of any of its superclasses.

      Subclasses must override this to compare their own fields.

      Overrides:
      equals in class ContentEvent
      Parameters:
      o - the object to compare.
      Returns:
      true, if the given object has the same runtime class as this object's runtime class, and the event sources are equal.
    • hashCode

      public int hashCode()
      Description copied from class: ConfluenceEvent
      Subclasses must override this to hash their own fields.
      Overrides:
      hashCode in class ContentEvent
      Returns:
      the hashcode