Merge pull request #504 from JonathanLennox/StanzaBuilder-remove-extension

Add removeExtension methods to StanzaBuilder.
master
Florian Schmaus 10 months ago committed by GitHub
commit 7fd300888e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 13
      smack-core/src/main/java/org/jivesoftware/smack/packet/StanzaBuilder.java

@ -184,6 +184,19 @@ public abstract class StanzaBuilder<B extends StanzaBuilder<B>> implements Stanz
return getThis();
}
public final B removeExtension(String elementName, String namespace) {
QName key = new QName(namespace, elementName);
extensionElements.remove(key);
return getThis();
}
public final B removeExtension(ExtensionElement extension) {
QName key = extension.getQName();
List<ExtensionElement> list = extensionElements.getAll(key);
list.remove(extension);
return getThis();
}
public abstract Stanza build();
public abstract B getThis();

Loading…
Cancel
Save