File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Client/src/main/java/io/github/jwdeveloper/tiktok/http/mappers Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 2727import io .github .jwdeveloper .tiktok .data .models .gifts .Gift ;
2828import io .github .jwdeveloper .tiktok .data .requests .GiftsData ;
2929
30+ import java .util .ArrayList ;
3031import java .util .List ;
3132
3233public class GiftsDataMapper {
@@ -56,9 +57,13 @@ public GiftsData.Response mapRoom(String json) {
5657 var parsedJson = JsonParser .parseString (json );
5758 var jsonObject = parsedJson .getAsJsonObject ();
5859 if (jsonObject .get ("data" ) instanceof JsonObject data && data .get ("gifts" ) instanceof JsonArray giftArray ) {
59- var gifts = giftArray .asList ().parallelStream ()
60- .map (this ::mapSingleRoomGift )
61- .toList ();
60+ var gifts = new ArrayList <Gift >();
61+
62+ for (int i = 0 ; i < giftArray .size (); i ++) {
63+ JsonElement element = giftArray .get (i );
64+ Gift gift = mapSingleRoomGift (element );
65+ gifts .add (gift );
66+ }
6267
6368 return new GiftsData .Response (json , gifts );
6469 }
You can’t perform that action at this time.
0 commit comments