mirror of
https://github.com/moparisthebest/Conversations
synced 2025-02-10 20:00:10 -05:00
40 lines
709 B
Java
40 lines
709 B
Java
package eu.siacs.conversations.xmpp.stanzas;
|
|
|
|
import eu.siacs.conversations.xml.Element;
|
|
import eu.siacs.conversations.xmpp.jid.Jid;
|
|
|
|
public class AbstractStanza extends Element {
|
|
|
|
protected AbstractStanza(String name) {
|
|
super(name);
|
|
}
|
|
|
|
public Jid getTo() {
|
|
return getAttributeAsJid("to");
|
|
}
|
|
|
|
public Jid getFrom() {
|
|
return getAttributeAsJid("from");
|
|
}
|
|
|
|
public String getId() {
|
|
return this.getAttribute("id");
|
|
}
|
|
|
|
public void setTo(final Jid to) {
|
|
if (to != null) {
|
|
setAttribute("to", to.toString());
|
|
}
|
|
}
|
|
|
|
public void setFrom(final Jid from) {
|
|
if (from != null) {
|
|
setAttribute("from", from.toString());
|
|
}
|
|
}
|
|
|
|
public void setId(final String id) {
|
|
setAttribute("id", id);
|
|
}
|
|
}
|