X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Firc%2Fevent%2FAbstractReplyEvent.java;fp=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Firc%2Fevent%2FAbstractReplyEvent.java;h=e940c6cd99c15c71249cd7f85149a19030f4bc40;hb=3cc15ebd7eb8ade802b9a039873f6dbe5c185594;hp=0000000000000000000000000000000000000000;hpb=2dd358e3abdf111b8f8c269f317ce402e1aa7993;p=xudocci.git
diff --git a/src/main/java/net/pterodactylus/irc/event/AbstractReplyEvent.java b/src/main/java/net/pterodactylus/irc/event/AbstractReplyEvent.java
new file mode 100644
index 0000000..e940c6c
--- /dev/null
+++ b/src/main/java/net/pterodactylus/irc/event/AbstractReplyEvent.java
@@ -0,0 +1,61 @@
+/*
+ * XdccDownloader - AbstractReplyEvent.java - Copyright © 2013 David Roden
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package net.pterodactylus.irc.event;
+
+import net.pterodactylus.irc.Connection;
+import net.pterodactylus.irc.Reply;
+
+/**
+ * Abstract base class for all events based on {@link Reply}s (and thus very low
+ * level). Examples would be e.g. nick changing messages, mode changes, private
+ * messages, and other single/global events that do not carry state.
+ *
+ * @author David âBombeâ Roden
+ */
+public abstract class AbstractReplyEvent extends AbstractConnectionEvent {
+
+ /** The reply that caused this event. */
+ private final Reply reply;
+
+ /**
+ * Creates a new abstract reply event.
+ *
+ * @param connection
+ * The connection the event occured on
+ * @param reply
+ * The reply that caused this event
+ */
+ protected AbstractReplyEvent(Connection connection, Reply reply) {
+ super(connection);
+ this.reply = reply;
+ }
+
+ //
+ // ACCESSORS
+ //
+
+ /**
+ * Returns the reply that caused this event.
+ *
+ * @return The reply that caused this event
+ */
+ public Reply reply() {
+ return reply;
+ }
+
+}