From 0bb3bf292c051181fae272e1a0b5b97f3dc5dbaa Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Sat, 22 Jun 2024 20:01:19 +0200 Subject: [PATCH] [core] Add NotFilter.of(Class) --- .../java/org/jivesoftware/smack/filter/NotFilter.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/smack-core/src/main/java/org/jivesoftware/smack/filter/NotFilter.java b/smack-core/src/main/java/org/jivesoftware/smack/filter/NotFilter.java index 006b5f4f9..5589b2109 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/filter/NotFilter.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/filter/NotFilter.java @@ -1,6 +1,6 @@ /** * - * Copyright 2003-2007 Jive Software. + * Copyright 2003-2007 Jive Software, 2024 Florian Schmaus. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,6 +17,7 @@ package org.jivesoftware.smack.filter; +import org.jivesoftware.smack.packet.ExtensionElement; import org.jivesoftware.smack.packet.Stanza; import org.jivesoftware.smack.util.Objects; @@ -43,4 +44,9 @@ public class NotFilter implements StanzaFilter { public boolean accept(Stanza packet) { return !filter.accept(packet); } + + public static NotFilter of(Class extensionElementClass) { + ExtensionElementFilter extensionElementFilter = new ExtensionElementFilter<>(extensionElementClass); + return new NotFilter(extensionElementFilter); + } }