From a806595a772068a95df31c6907d0d3593e045718 Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Sun, 2 May 2021 17:12:22 +0200 Subject: [PATCH] [core] Move IqData construction API to the right place AbstractIqBuilder is the wrong place for those methods, they belong in IqData. --- .../org/jivesoftware/smack/packet/AbstractIqBuilder.java | 2 ++ .../main/java/org/jivesoftware/smack/packet/IqData.java | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/smack-core/src/main/java/org/jivesoftware/smack/packet/AbstractIqBuilder.java b/smack-core/src/main/java/org/jivesoftware/smack/packet/AbstractIqBuilder.java index 5eac12435..ad4c4101d 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/packet/AbstractIqBuilder.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/packet/AbstractIqBuilder.java @@ -40,10 +40,12 @@ public abstract class AbstractIqBuilder> extend super(stanzaId); } + // TODO: Deprecate and use corresponding method in IqData instead. public static IqData createResponse(IqView request) { return createResponse(request, IQ.ResponseType.result); } + // TODO: Deprecate and use corresponding method in IqData instead. public static IqData createErrorResponse(IqView request) { return createResponse(request, IQ.ResponseType.error); } diff --git a/smack-core/src/main/java/org/jivesoftware/smack/packet/IqData.java b/smack-core/src/main/java/org/jivesoftware/smack/packet/IqData.java index 18173ffeb..e20c70684 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/packet/IqData.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/packet/IqData.java @@ -46,4 +46,12 @@ public final class IqData extends AbstractIqBuilder { public Stanza build() { throw new UnsupportedOperationException(); } + + public static IqData createResponseData(IqView request) { + return createResponse(request, IQ.ResponseType.result); + } + + public static IqData createErrorResponseDAta(IqView request) { + return createResponse(request, IQ.ResponseType.error); + } }