import java.util.List;
import java.util.Map;
public class Bsonify {
public static BSONObject queryToBson(Query query) {
BSONObject b = new BasicBSONObject();
b.put("Sql", query.getSql());
b.put("Keyspace", query.getKeyspace());
b.put("TabletType", query.getTabletType());
if (query.getBindVars() != null) {
b.put("BindVariables", bindVarsToBSON(query.getBindVars()));
}
if (query.getKeyspaceIds() != null) {
b.put("KeyspaceIds", query.getKeyspaceIds());
} else {
b.put("KeyRanges", query.getKeyRanges());
}
if (query.getSession() != null) {
b.put("Session", query.getSession());
}
return b;
}