Commit b327b1f2 authored by Daniel Henninger's avatar Daniel Henninger Committed by dhenninger

Added some convenience routines.

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@9465 b35dd754-fafc-0310-a699-88a17e54d16e
parent d00307da
...@@ -123,6 +123,26 @@ public class IQ extends Packet { ...@@ -123,6 +123,26 @@ public class IQ extends Packet {
element.addAttribute("type", type==null?null:type.toString()); element.addAttribute("type", type==null?null:type.toString());
} }
/**
* Convenience routine to indicate if this is a request stanza. (get or set)
*
* @return True or false if this is a request stanza
*/
public boolean isRequest() {
Type type = getType();
return (type != null && (type.equals(Type.get) || type.equals(Type.set)));
}
/**
* Convenience routine to indicate if this is a response stanza. (result or error)
*
* @return True or false if this is a response stanza
*/
public boolean isResponse() {
Type type = getType();
return (type != null && (type.equals(Type.result) || type.equals(Type.error)));
}
/** /**
* Returns the child element of this IQ. IQ packets may have a single child * Returns the child element of this IQ. IQ packets may have a single child
* element in an extended namespace. This is a convenience method to * element in an extended namespace. This is a convenience method to
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment