mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-22 12:02:05 +01:00
[core] Add XmlStringBuilder.jidAttribute(Jid) and optJidAttribute(Jid)
This commit is contained in:
parent
b7218e3a72
commit
726dbc0d27
1 changed files with 13 additions and 0 deletions
|
@ -28,6 +28,7 @@ import org.jivesoftware.smack.packet.NamedElement;
|
||||||
import org.jivesoftware.smack.packet.XmlElement;
|
import org.jivesoftware.smack.packet.XmlElement;
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
|
|
||||||
|
import org.jxmpp.jid.Jid;
|
||||||
import org.jxmpp.util.XmppDateTime;
|
import org.jxmpp.util.XmppDateTime;
|
||||||
|
|
||||||
public class XmlStringBuilder implements Appendable, CharSequence, Element {
|
public class XmlStringBuilder implements Appendable, CharSequence, Element {
|
||||||
|
@ -311,6 +312,18 @@ public class XmlStringBuilder implements Appendable, CharSequence, Element {
|
||||||
return attribute(name, String.valueOf(value));
|
return attribute(name, String.valueOf(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public XmlStringBuilder jidAttribute(Jid jid) {
|
||||||
|
assert jid != null;
|
||||||
|
return attribute("jid", jid);
|
||||||
|
}
|
||||||
|
|
||||||
|
public XmlStringBuilder optJidAttribute(Jid jid) {
|
||||||
|
if (jid != null) {
|
||||||
|
attribute("jid", jid);
|
||||||
|
}
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public XmlStringBuilder optAttribute(String name, String value) {
|
public XmlStringBuilder optAttribute(String name, String value) {
|
||||||
if (value != null) {
|
if (value != null) {
|
||||||
attribute(name, value);
|
attribute(name, value);
|
||||||
|
|
Loading…
Reference in a new issue