1package eu.siacs.conversations.xmpp.stanzas;
2
3
4public class IqPacket extends AbstractStanza {
5
6 public static final int TYPE_SET = 0;
7 public static final int TYPE_RESULT = 1;
8 public static final int TYPE_GET = 2;
9
10 private IqPacket(String name) {
11 super(name);
12 }
13
14 public IqPacket(int type) {
15 super("iq");
16 switch (type) {
17 case TYPE_SET:
18 this.setAttribute("type", "set");
19 break;
20 case TYPE_GET:
21 this.setAttribute("type", "get");
22 break;
23 case TYPE_RESULT:
24 this.setAttribute("type", "result");
25 break;
26 default:
27 break;
28 }
29 }
30
31 public IqPacket() {
32 super("iq");
33 }
34
35}