1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-25 15:52:06 +01:00

Type parsing now handles null.

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@1785 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Matt Tucker 2003-01-15 15:02:57 +00:00 committed by mtucker
parent 6696541c43
commit 59a0402000

View file

@ -57,7 +57,7 @@ package org.jivesoftware.smack.packet;
* *
* @author Matt Tucker * @author Matt Tucker
*/ */
public abstract class IQ extends Packet { public class IQ extends Packet {
private Type type = Type.GET; private Type type = Type.GET;
@ -114,7 +114,9 @@ public abstract class IQ extends Packet {
* *
* @return the query section of the IQ XML. * @return the query section of the IQ XML.
*/ */
public abstract String getQueryXML(); public String getQueryXML() {
return null;
}
/** /**
* A class to represent the type of the IQ packet. Valid types are: * A class to represent the type of the IQ packet. Valid types are:
@ -134,16 +136,16 @@ public abstract class IQ extends Packet {
public static final Type ERROR = new Type("error"); public static final Type ERROR = new Type("error");
public static Type fromString(String type) { public static Type fromString(String type) {
if (type.equals(GET.toString())) { if (GET.toString().equals(type)) {
return GET; return GET;
} }
else if (type.equals(SET.toString())) { else if (SET.toString().equals(type)) {
return SET; return SET;
} }
else if (type.equals(ERROR.toString())) { else if (ERROR.toString().equals(type)) {
return ERROR; return ERROR;
} }
else if (type.equals(RESULT.toString())) { else if (RESULT.toString().equals(type)) {
return RESULT; return RESULT;
} }
else { else {