From 72acd8e09509162b5fa748ebb65ce65a22d3882e Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Sun, 8 Nov 2020 22:13:49 +0100 Subject: [PATCH] [core] Add StanzaBuilder.build() --- .../main/java/org/jivesoftware/smack/packet/IqBuilder.java | 1 + .../main/java/org/jivesoftware/smack/packet/IqData.java | 7 ++++++- .../smack/packet/MessageOrPresenceBuilder.java | 1 + .../java/org/jivesoftware/smack/packet/StanzaBuilder.java | 4 +++- 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/smack-core/src/main/java/org/jivesoftware/smack/packet/IqBuilder.java b/smack-core/src/main/java/org/jivesoftware/smack/packet/IqBuilder.java index 644f077ea..03d15f973 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/packet/IqBuilder.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/packet/IqBuilder.java @@ -43,6 +43,7 @@ public abstract class IqBuilder, I extends IQ> return getThis(); } + @Override public abstract I build(); } 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 deba5486e..18173ffeb 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 @@ -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. @@ -41,4 +41,9 @@ public final class IqData extends AbstractIqBuilder { public IqData getThis() { return this; } + + @Override + public Stanza build() { + throw new UnsupportedOperationException(); + } } diff --git a/smack-core/src/main/java/org/jivesoftware/smack/packet/MessageOrPresenceBuilder.java b/smack-core/src/main/java/org/jivesoftware/smack/packet/MessageOrPresenceBuilder.java index 9a3ff66a0..1caab5c04 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/packet/MessageOrPresenceBuilder.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/packet/MessageOrPresenceBuilder.java @@ -37,6 +37,7 @@ public abstract class MessageOrPresenceBuilder> implements Stanz return getThis(); } + public abstract Stanza build(); + public abstract B getThis(); @Override