public class QueryRequestJsonUnmarshaller implements Unmarshaller<QueryRequest, JsonUnmarshallerContext> {
public QueryRequest unmarshall(JsonUnmarshallerContext context) throws Exception {
QueryRequest request = new QueryRequest();
int originalDepth = context.getCurrentDepth();
int targetDepth = originalDepth + 1;
JsonToken token = context.currentToken;
if (token == null) token = context.nextToken();
while (true) {
if (token == null) break;
if (token == JsonToken.FIELD_NAME || token == JsonToken.START_OBJECT) {
if (context.testExpression("TableName", targetDepth)) {
context.nextToken();
request.setTableName(SimpleTypeJsonUnmarshallers.StringJsonUnmarshaller.getInstance().unmarshall(context));
}
if (context.testExpression("Limit", targetDepth)) {
context.nextToken();
request.setLimit(SimpleTypeJsonUnmarshallers.IntegerJsonUnmarshaller.getInstance().unmarshall(context));
}
if (context.testExpression("Count", targetDepth)) {
context.nextToken();
request.setCount(SimpleTypeJsonUnmarshallers.BooleanJsonUnmarshaller.getInstance().unmarshall(context));
}
if (context.testExpression("ConsistentRead", targetDepth)) {
context.nextToken();
request.setConsistentRead(SimpleTypeJsonUnmarshallers.BooleanJsonUnmarshaller.getInstance().unmarshall(context));
}
if (context.testExpression("ScanIndexForward", targetDepth)) {
context.nextToken();
request.setScanIndexForward(SimpleTypeJsonUnmarshallers.BooleanJsonUnmarshaller.getInstance().unmarshall(context));
}
if (context.testExpression("HashKeyValue", targetDepth)) {
request.setHashKeyValue(AttributeValueJsonUnmarshaller.getInstance().unmarshall(context));
}
if (context.testExpression("RangeKeyCondition", targetDepth)) {
request.setRangeKeyCondition(new ConditionJsonUnmarshaller().unmarshall(context));
}
if (context.testExpression("ExclusiveStartKey", targetDepth)) {
request.setExclusiveStartKey(KeyJsonUnmarshaller.getInstance().unmarshall(context));
}
if (context.testExpression("AttributesToGet", targetDepth)) {
request.setAttributesToGet(new ListUnmarshaller<String>(SimpleTypeJsonUnmarshallers.StringJsonUnmarshaller.getInstance()).unmarshall(context));
}
} else if (token == JsonToken.END_ARRAY || token == JsonToken.END_OBJECT) {
if (context.getCurrentDepth() <= originalDepth) break;
}
token = context.nextToken();