Commit e8a707c6 by TongZuu

resolve requestid for handle request is have double qoute

parent f0d17541
......@@ -2,3 +2,4 @@
/ArrayDeserializer.class
/ByteBufferDeserialize.class
/ByteStringDeserialize.class
/StringArrayRequestID.class
......@@ -15,7 +15,12 @@ public class ArrayDeserializer implements JsonDeserializer<String[]>{
int size = json.getAsJsonArray().size();
String[] result = new String[size];
for(int i = 0; i < size; i++){
result[i] = json.getAsJsonArray().get(i).toString();
if(json.getAsJsonArray().get(i).isJsonObject()){
result[i] = json.getAsJsonArray().get(i).toString();
}else{
result[i] = json.getAsJsonArray().get(i).getAsString();
}
}
return result;
......
package com.csc.library.gson;
import java.lang.reflect.Type;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonParseException;
public class StringArrayRequestID implements JsonDeserializer<String[]>{
@Override
public String[] deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context)
throws JsonParseException {
String[] xx = new String[2];
return xx;
}
}
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