1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-09-10 17:49:38 +02:00
This commit is contained in:
vanitasvitae 2017-07-17 20:18:08 +02:00
parent 59e79ef668
commit 7658369d63
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311
26 changed files with 268 additions and 356 deletions

View file

@ -271,6 +271,11 @@ public class XmlStringBuilder implements Appendable, CharSequence {
return attribute(name, String.valueOf(value));
}
public XmlStringBuilder attribute(String name, long value) {
assert name != null;
return attribute(name, String.valueOf(value));
}
public XmlStringBuilder optAttribute(String name, String value) {
if (value != null) {
attribute(name, value);
@ -278,6 +283,13 @@ public class XmlStringBuilder implements Appendable, CharSequence {
return this;
}
public XmlStringBuilder optAttribute(String name, Long value) {
if (value != null) {
attribute(name, value);
}
return this;
}
/**
* Add a new attribute to this builder, with the {@link java.util.Date} instance as its value,
* which will get formated with {@link XmppDateTime#formatXEP0082Date(Date)}