mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-09 17:19:39 +02:00
Add XmlStringBuilder.optAttribute(String, Number)
This commit is contained in:
parent
0e52560358
commit
505493d889
2 changed files with 9 additions and 7 deletions
|
@ -327,6 +327,13 @@ public class XmlStringBuilder implements Appendable, CharSequence, Element {
|
|||
return this;
|
||||
}
|
||||
|
||||
public XmlStringBuilder optAttribute(String name, Number number) {
|
||||
if (number != null) {
|
||||
attribute(name, number.toString());
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the given attribute if {@code value => 0}.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue