X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fnotify%2FListNotificationFilter.java;h=739907cc04607ffe66c3e15f2741a26b90c33036;hb=bf9d78ae8c577a31e6477afc4cfebcf024df3596;hp=7084e66bf9a051ad4c364cf3302a17f29ee3fab1;hpb=b18bac64e8cdd43a34aa1449f6c335cdda463a0b;p=Sone.git
diff --git a/src/main/java/net/pterodactylus/sone/notify/ListNotificationFilter.java b/src/main/java/net/pterodactylus/sone/notify/ListNotificationFilter.java
index 7084e66..739907c 100644
--- a/src/main/java/net/pterodactylus/sone/notify/ListNotificationFilter.java
+++ b/src/main/java/net/pterodactylus/sone/notify/ListNotificationFilter.java
@@ -1,5 +1,5 @@
/*
- * Sone - ListNotificationFilters.java - Copyright © 2010â2015 David Roden
+ * Sone - ListNotificationFilter.java - Copyright © 2010â2020 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
@@ -36,8 +36,6 @@ import com.google.common.base.Optional;
/**
* Filter for {@link ListNotification}s.
- *
- * @author David âBombeâ Roden
*/
@Singleton
public class ListNotificationFilter {
@@ -67,7 +65,7 @@ public class ListNotificationFilter {
*/
@SuppressWarnings("unchecked")
public List filterNotifications(Collection extends Notification> notifications, Sone currentSone) {
- List filteredNotifications = new ArrayList();
+ List filteredNotifications = new ArrayList<>();
for (Notification notification : notifications) {
if (notification.getId().equals("new-sone-notification")) {
if ((currentSone != null) && !currentSone.getOptions().isShowNewSoneNotifications()) {
@@ -128,7 +126,7 @@ public class ListNotificationFilter {
if (newPosts.size() == postNotification.getElements().size()) {
return Optional.of(postNotification);
}
- ListNotification filteredNotification = new ListNotification(postNotification);
+ ListNotification filteredNotification = new ListNotification<>(postNotification);
filteredNotification.setElements(newPosts);
filteredNotification.setLastUpdateTime(postNotification.getLastUpdatedTime());
return Optional.of(filteredNotification);
@@ -157,7 +155,7 @@ public class ListNotificationFilter {
if (newReplies.size() == newReplyNotification.getElements().size()) {
return Optional.of(newReplyNotification);
}
- ListNotification filteredNotification = new ListNotification(newReplyNotification);
+ ListNotification filteredNotification = new ListNotification<>(newReplyNotification);
filteredNotification.setElements(newReplies);
filteredNotification.setLastUpdateTime(newReplyNotification.getLastUpdatedTime());
return Optional.of(filteredNotification);