mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2025-09-09 10:19:41 +02:00
Merge branch '4.4'
This commit is contained in:
commit
35a71f0131
3 changed files with 38 additions and 2 deletions
|
@ -389,6 +389,22 @@ public class XmlStringBuilder implements Appendable, CharSequence, Element {
|
|||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* If the provided Integer argument is not null, then add a new XML attribute with the given name and the Integer as
|
||||
* value.
|
||||
*
|
||||
* @param name the XML attribute name.
|
||||
* @param value the optional integer to use as the attribute's value.
|
||||
* @return a reference to this object.
|
||||
* @since 4.4.1
|
||||
*/
|
||||
public XmlStringBuilder optIntAttribute(String name, Integer value) {
|
||||
if (value != null) {
|
||||
attribute(name, value.toString());
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the given attribute if value not null and {@code value => 0}.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue