mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-10 09:39:39 +02:00
Cleanup carbons, forwarded and a few others API
Adopt to common design patterns in Smack: - getFrom(Packet) in Packetextensions - INSTANCES.put() in getInstanceFor() - ELEMENT instead of ELEMENT_NAME - Use XmlStringBuilder
This commit is contained in:
parent
1ed5c48bcc
commit
49ee058c38
14 changed files with 105 additions and 90 deletions
|
@ -160,6 +160,20 @@ public class XmlStringBuilder implements Appendable, CharSequence {
|
|||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the given attribute if value => 0
|
||||
*
|
||||
* @param name
|
||||
* @param value
|
||||
* @return a reference to this object
|
||||
*/
|
||||
public XmlStringBuilder optLongAttribute(String name, Long value) {
|
||||
if (value >= 0) {
|
||||
attribute(name, Long.toString(value));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public XmlStringBuilder xmlnsAttribute(String value) {
|
||||
optAttribute("xmlns", value);
|
||||
return this;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue