From 42416a694f60f8477e2c5b9bad8e950307a561c7 Mon Sep 17 00:00:00 2001 From: Hammy Date: Wed, 28 Jul 2021 23:32:48 +0100 Subject: [PATCH] Step away from subscribe() & unsubscribe() --- src/main/java/me/goudham/EventManager.java | 4 ++-- src/main/java/me/goudham/MyClipboard.java | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/me/goudham/EventManager.java b/src/main/java/me/goudham/EventManager.java index f3ef29d..f1ed04b 100644 --- a/src/main/java/me/goudham/EventManager.java +++ b/src/main/java/me/goudham/EventManager.java @@ -18,7 +18,7 @@ class EventManager { * * @param clipboardEvent The {@link ClipboardEvent} to be added */ - void subscribe(ClipboardEvent clipboardEvent) { + void addEventListener(ClipboardEvent clipboardEvent) { eventListeners.add(clipboardEvent); } @@ -27,7 +27,7 @@ class EventManager { * * @param clipboardEvent The {@link ClipboardEvent} to be removed */ - void unsubscribe(ClipboardEvent clipboardEvent) { + void removeEventListener(ClipboardEvent clipboardEvent) { eventListeners.remove(clipboardEvent); } diff --git a/src/main/java/me/goudham/MyClipboard.java b/src/main/java/me/goudham/MyClipboard.java index ec74e57..dbe3724 100644 --- a/src/main/java/me/goudham/MyClipboard.java +++ b/src/main/java/me/goudham/MyClipboard.java @@ -50,8 +50,8 @@ public class MyClipboard { * @param clipboardEvent The {@link ClipboardEvent} to be added * @see EventManager */ - public void subscribe(ClipboardEvent clipboardEvent) { - clipboardListener.getEventManager().subscribe(clipboardEvent); + public void addEventListener(ClipboardEvent clipboardEvent) { + clipboardListener.getEventManager().addEventListener(clipboardEvent); } /** @@ -60,8 +60,8 @@ public class MyClipboard { * @param clipboardEvent The {@link ClipboardEvent} to be removed * @see EventManager */ - public void unsubscribe(ClipboardEvent clipboardEvent) { - clipboardListener.getEventManager().unsubscribe(clipboardEvent); + public void removeEventListener(ClipboardEvent clipboardEvent) { + clipboardListener.getEventManager().removeEventListener(clipboardEvent); }