1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-09-09 09:09:38 +02:00

Add XmlStringBuilder.optAttribute(String, Number)

This commit is contained in:
Florian Schmaus 2019-05-07 10:18:55 +02:00
parent 0e52560358
commit 505493d889
2 changed files with 9 additions and 7 deletions

View file

@ -103,13 +103,8 @@ public class Range implements NamedElement {
public CharSequence toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
XmlStringBuilder sb = new XmlStringBuilder(this);
// TODO: (Introduce and) use XmlStringBuilder.optXmlAttribute(name, Number).
if (offset != null) {
sb.attribute(ATTR_OFFSET, offset);
}
if (length != null) {
sb.attribute(ATTR_LENGTH, length);
}
sb.optAttribute(ATTR_OFFSET, offset);
sb.optAttribute(ATTR_LENGTH, length);
if (hash != null) {
sb.rightAngleBracket();