From acf80bddd07d5579cdb20a888b3f9e99e53030a5 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Fri, 28 Feb 2014 18:46:01 +0100 Subject: rebranding --- src/eu/siacs/conversations/xmpp/IqPacket.java | 40 +++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 src/eu/siacs/conversations/xmpp/IqPacket.java (limited to 'src/eu/siacs/conversations/xmpp/IqPacket.java') diff --git a/src/eu/siacs/conversations/xmpp/IqPacket.java b/src/eu/siacs/conversations/xmpp/IqPacket.java new file mode 100644 index 00000000..2319fd28 --- /dev/null +++ b/src/eu/siacs/conversations/xmpp/IqPacket.java @@ -0,0 +1,40 @@ +package eu.siacs.conversations.xmpp; + +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"); + } + +} -- cgit v1.2.3