1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-25 21:42:07 +01:00

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

Add removeExtension methods to StanzaBuilder.
This commit is contained in:
Florian Schmaus 2021-10-25 16:58:49 +02:00 committed by GitHub
commit 7fd300888e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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();