anotherim/src/eu/siacs/conversations/xmpp/IqPacket.java

41 lines
692 B
Java
Raw Normal View History

2014-02-28 17:46:01 +00:00
package eu.siacs.conversations.xmpp;
2014-02-28 17:46:01 +00:00
import eu.siacs.conversations.xml.Element;
public class IqPacket extends Element {
public static final int TYPE_SET = 0;
public static final int TYPE_RESULT = 1;
public static final int TYPE_GET = 2;
private IqPacket(String name) {
super(name);
}
public IqPacket(int type) {
super("iq");
switch (type) {
case TYPE_SET:
this.setAttribute("type", "set");
break;
case TYPE_GET:
this.setAttribute("type", "get");
break;
case TYPE_RESULT:
this.setAttribute("type", "result");
break;
default:
break;
}
}
public IqPacket() {
super("iq");
}
public String getId() {
return this.getAttribute("id");
}
}