From 87e0ac9ba128571a3eb5516595103175bd060f61 Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Mon, 8 Apr 2019 23:04:25 +0200 Subject: [PATCH] Add IQ.isResponseIQ() --- .../main/java/org/jivesoftware/smack/packet/IQ.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/smack-core/src/main/java/org/jivesoftware/smack/packet/IQ.java b/smack-core/src/main/java/org/jivesoftware/smack/packet/IQ.java index 3626b9b9b..591f94261 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/packet/IQ.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/packet/IQ.java @@ -105,6 +105,16 @@ public abstract class IQ extends Stanza { } } + /** + * Return true if this IQ is a request, i.e. an IQ of type {@link Type#result} or {@link Type#error}. + * + * @return true if IQ type is 'result' or 'error', false otherwise. + * @since 4.4 + */ + public boolean isResponseIQ() { + return !isRequestIQ(); + } + public final String getChildElementName() { return childElementName; }