X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fnotify%2FListNotification.java;h=7a0d6f8ac02f8ec4f9c3abe98dc28ec2b7c76a3d;hb=ad1207b7f2d8e7de1ee488a7b8994516c888e7a8;hp=64c2ecbac0240a19f0bff32d1ef431e5fd7bf612;hpb=2889127f645d17c4ae0a650e935d1481d9cbd727;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/notify/ListNotification.java b/src/main/java/net/pterodactylus/sone/notify/ListNotification.java index 64c2ecb..7a0d6f8 100644 --- a/src/main/java/net/pterodactylus/sone/notify/ListNotification.java +++ b/src/main/java/net/pterodactylus/sone/notify/ListNotification.java @@ -56,6 +56,15 @@ public class ListNotification extends TemplateNotification { // /** + * Returns the current list of elements. + * + * @return The current list of elements + */ + public List getElements() { + return new ArrayList(elements); + } + + /** * Returns whether there are any new elements. * * @return {@code true} if there are no new elements, {@code false} if there @@ -84,6 +93,9 @@ public class ListNotification extends TemplateNotification { */ public void remove(T element) { elements.remove(element); + if (elements.isEmpty()) { + dismiss(); + } touch(); }