1 package com.atlassian.johnson.event;
2
3 import javax.annotation.Nonnull;
4 import java.util.EventObject;
5
6 import static com.google.common.base.Preconditions.checkNotNull;
7
8 /**
9 * An {@code EventObject} indicating the provided {@link Event} should be removed from the Johnson event container.
10 *
11 * @since 2.0
12 */
13 public class RemoveEvent extends EventObject {
14
15 private final Event event;
16
17 /**
18 * Constructs a new {@code RemoveEvent}, setting its source and the Johnson {@link Event} to be removed.
19 *
20 * @param o the event source
21 * @param event the event to removed
22 */
23 public RemoveEvent(@Nonnull Object o, @Nonnull Event event) {
24 super(o);
25
26 this.event = checkNotNull(event, "event");
27 }
28
29 /**
30 * Retrieves the Johnson {@link Event} to remove from the container.
31 *
32 * @return the event to remove
33 */
34 @Nonnull
35 public Event getEvent() {
36 return event;
37 }
38 }