From 8d432e23030c85306ed0861b3197f2349c34c86a Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Sun, 5 Apr 2020 19:59:24 +0200 Subject: [PATCH] Add StanzaView.hasExtension(Class) --- .../main/java/org/jivesoftware/smack/packet/StanzaView.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/smack-core/src/main/java/org/jivesoftware/smack/packet/StanzaView.java b/smack-core/src/main/java/org/jivesoftware/smack/packet/StanzaView.java index ff9874f13..9ba4febcf 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/packet/StanzaView.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/packet/StanzaView.java @@ -1,6 +1,6 @@ /** * - * Copyright 2019 Florian Schmaus + * Copyright 2019-2020 Florian Schmaus * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -67,6 +67,10 @@ public interface StanzaView extends XmlLangElement { return getExtension(qname) != null; } + default boolean hasExtension(Class extensionElementClass) { + return getExtension(extensionElementClass) != null; + } + /** * Check if a extension element with the given namespace exists. *