导航菜单

页面标题

页面副标题

OLX India v19.42.007 - BannerRepositoryImpl.java 源代码

正在查看: OLX India v19.42.007 应用的 BannerRepositoryImpl.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.naspers.ragnarok.data.repository.banner;

import com.naspers.ragnarok.core.util.s;
import com.naspers.ragnarok.data.repository.transformer.BannerTransformer;
import com.naspers.ragnarok.domain.constant.Constants;
import com.naspers.ragnarok.domain.entity.banner.BannerCondition;
import com.naspers.ragnarok.domain.entity.banner.BannerConditions;
import com.naspers.ragnarok.domain.entity.banner.BannerCta;
import com.naspers.ragnarok.domain.entity.banner.BannerDetails;
import com.naspers.ragnarok.domain.entity.banner.BannerFallbackDetails;
import com.naspers.ragnarok.domain.entity.banner.BannerListings;
import com.naspers.ragnarok.domain.entity.banner.BannerNodeInfo;
import com.naspers.ragnarok.domain.entity.banner.BannerText;
import com.naspers.ragnarok.domain.entity.banner.RagnarokBannerActionType;
import com.naspers.ragnarok.domain.entity.banner.RagnarokBannerTemplateType;
import com.naspers.ragnarok.domain.message.interactor.SendMessageUseCase;
import com.naspers.ragnarok.domain.repository.banner.BannerRepository;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
import kotlin.Metadata;
import kotlin.collections.CollectionsKt;
import kotlin.comparisons.ComparisonsKt;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.SourceDebugExtension;

@Metadata
@SourceDebugExtension
public final class BannerRepositoryImpl implements BannerRepository {
    private final List<BannerCondition> conditionsList = CollectionsKt.k();

    private final List<BannerDetails> getBannerTest() {
        List list;
        BannerCta bannerCta;
        Object obj;
        BannerCta bannerCta2;
        Object obj2;
        RagnarokBannerTemplateType ragnarokBannerTemplateType = RagnarokBannerTemplateType.TEMPLATE_1;
        BannerText bannerText = new BannerText("Interested in the car?", "#004896", "xlarge", "bold");
        BannerText bannerText2 = new BannerText("Let our experts help you close the deal faster", "#004896", "small", "normal");
        RagnarokBannerActionType ragnarokBannerActionType = RagnarokBannerActionType.CALL_BACK_REQUESTED;
        BannerNodeInfo bannerNodeInfo = new BannerNodeInfo(ragnarokBannerTemplateType, bannerText, bannerText2, CollectionsKt.n(new BannerCta[]{new BannerCta("Request Call Back", ragnarokBannerActionType, "#004896", "small", "normal"), new BannerCta("Request Call Back", ragnarokBannerActionType, "#004896", "small", "normal"), new BannerCta("Request Call Back", ragnarokBannerActionType, "#004896", "small", "normal")}), "", "", "", "#ffffff", Boolean.TRUE, null);
        List e = CollectionsKt.e("false");
        Boolean bool = Boolean.FALSE;
        List n = CollectionsKt.n(new BannerDetails[]{new BannerDetails(bannerNodeInfo, new BannerConditions(Constants.ExtraValues.ADPV, CollectionsKt.n(new BannerCondition[]{new BannerCondition(Constants.ExtraValues.CONVERSATION, "callback_requested", "a", "equal", e, bool), new BannerCondition("feature_flag", SendMessageUseCase.Params.DataKeys.CALL_REQUESTED, "b", "equal", CollectionsKt.e("true"), bool), new BannerCondition("ad", "categories", "c", "in", CollectionsKt.n(new String[]{"84", "104"}), bool), new BannerCondition(Constants.SELLER, "dealer_type", "d", "in", CollectionsKt.n(new String[]{"Franchise", "OLX_Autos"}), bool), new BannerCondition("ab_experiment", "PAN-45440", "e", "equal", CollectionsKt.e("b"), bool)}), "(a and (b and (e and (c and d))))"), new BannerListings(2, Constants.ExtraValues.ADPV)), new BannerDetails(new BannerNodeInfo(RagnarokBannerTemplateType.TEMPLATE_2, new BannerText("BOOK YOUR HOME TEST DRIVE", "#ffffff", "large", "normal"), new BannerText("Available with flexible timing at your convenience", "#ffffff", "small", "normal"), CollectionsKt.e(new BannerCta("TRY NOW", RagnarokBannerActionType.HOME_TEST_DRIVE, "#ffffff", "small", "normal")), "", "https://statics.olx.co.id/external/base/img/chat/test_drive_icon_gif.json", "https://statics.olx.co.id/external/base/img/chat/test_drive_background.svg", "", bool, new BannerFallbackDetails("", "https://statics.olx.co.id/external/base/img/chat/test_drive_background.svg", null)), new BannerConditions(Constants.ExtraValues.ADPV, CollectionsKt.k(), "(a and (b or c))"), new BannerListings(1, Constants.ExtraValues.ADPV))});
        if (n != null) {
            ArrayList arrayList = new ArrayList();
            for (Object obj3 : n) {
                BannerDetails bannerDetails = (BannerDetails) obj3;
                if (bannerDetails.getBannerNodeInfo() != null) {
                    BannerListings bannerListings = bannerDetails.getBannerListings();
                    if ((bannerListings != null ? bannerListings.getPriority() : null) != null && bannerDetails.getBannerListings().getPriority().intValue() > 0) {
                        arrayList.add(obj3);
                    }
                }
            }
            ArrayList arrayList2 = new ArrayList();
            for (Object obj4 : arrayList) {
                BannerDetails bannerDetails2 = (BannerDetails) obj4;
                if (!Intrinsics.d(bannerDetails2.getBannerNodeInfo().getShowBannerActionUndefined(), Boolean.TRUE)) {
                    if (bannerDetails2.getBannerNodeInfo().getTemplateId() != null) {
                        List<BannerCta> cta = bannerDetails2.getBannerNodeInfo().getCta();
                        if (cta != null) {
                            Iterator<T> it = cta.iterator();
                            while (true) {
                                if (!it.hasNext()) {
                                    obj2 = null;
                                    break;
                                }
                                obj2 = it.next();
                                if (((BannerCta) obj2).getAction() != null) {
                                    break;
                                }
                            }
                            bannerCta2 = (BannerCta) obj2;
                        } else {
                            bannerCta2 = null;
                        }
                        if (bannerCta2 != null) {
                        }
                    }
                    BannerFallbackDetails bannerFallbackDetails = bannerDetails2.getBannerNodeInfo().getBannerFallbackDetails();
                    if ((bannerFallbackDetails != null ? bannerFallbackDetails.getAction() : null) != null) {
                    }
                }
                arrayList2.add(obj4);
            }
            list = CollectionsKt.H0(arrayList2, new Comparator() {
                @Override
                public final int compare(T t, T t2) {
                    return ComparisonsKt.d(((BannerDetails) t).getBannerListings().getPriority(), ((BannerDetails) t2).getBannerListings().getPriority());
                }
            });
        } else {
            list = null;
        }
        if (list == null) {
            return null;
        }
        ArrayList arrayList3 = new ArrayList();
        for (Object obj5 : list) {
            BannerDetails bannerDetails3 = (BannerDetails) obj5;
            if (bannerDetails3.getBannerNodeInfo() != null) {
                BannerListings bannerListings2 = bannerDetails3.getBannerListings();
                if ((bannerListings2 != null ? bannerListings2.getPriority() : null) != null && bannerDetails3.getBannerListings().getPriority().intValue() > 0) {
                    arrayList3.add(obj5);
                }
            }
        }
        ArrayList arrayList4 = new ArrayList();
        for (Object obj6 : arrayList3) {
            BannerDetails bannerDetails4 = (BannerDetails) obj6;
            if (!Intrinsics.d(bannerDetails4.getBannerNodeInfo().getShowBannerActionUndefined(), Boolean.TRUE)) {
                if (bannerDetails4.getBannerNodeInfo().getTemplateId() != null) {
                    List<BannerCta> cta2 = bannerDetails4.getBannerNodeInfo().getCta();
                    if (cta2 != null) {
                        Iterator<T> it2 = cta2.iterator();
                        while (true) {
                            if (!it2.hasNext()) {
                                obj = null;
                                break;
                            }
                            obj = it2.next();
                            if (((BannerCta) obj).getAction() != null) {
                                break;
                            }
                        }
                        bannerCta = (BannerCta) obj;
                    } else {
                        bannerCta = null;
                    }
                    if (bannerCta != null) {
                    }
                }
                BannerFallbackDetails bannerFallbackDetails2 = bannerDetails4.getBannerNodeInfo().getBannerFallbackDetails();
                if ((bannerFallbackDetails2 != null ? bannerFallbackDetails2.getAction() : null) != null) {
                }
            }
            arrayList4.add(obj6);
        }
        return CollectionsKt.H0(arrayList4, new Comparator() {
            @Override
            public final int compare(T t, T t2) {
                return ComparisonsKt.d(((BannerDetails) t).getBannerListings().getPriority(), ((BannerDetails) t2).getBannerListings().getPriority());
            }
        });
    }

    @Override
    public List<BannerDetails> getBannerDetail(String str) {
        BannerCta bannerCta;
        Object obj;
        if (str == null) {
            return null;
        }
        List<BannerDetails> bannerDetail = BannerTransformer.INSTANCE.getBannerDetail(s.e(), str);
        if (bannerDetail == null) {
            return null;
        }
        ArrayList arrayList = new ArrayList();
        for (Object obj2 : bannerDetail) {
            BannerDetails bannerDetails = (BannerDetails) obj2;
            if (bannerDetails.getBannerNodeInfo() != null) {
                BannerListings bannerListings = bannerDetails.getBannerListings();
                if ((bannerListings != null ? bannerListings.getPriority() : null) != null && bannerDetails.getBannerListings().getPriority().intValue() > 0) {
                    arrayList.add(obj2);
                }
            }
        }
        ArrayList arrayList2 = new ArrayList();
        for (Object obj3 : arrayList) {
            BannerDetails bannerDetails2 = (BannerDetails) obj3;
            if (!Intrinsics.d(bannerDetails2.getBannerNodeInfo().getShowBannerActionUndefined(), Boolean.TRUE)) {
                if (bannerDetails2.getBannerNodeInfo().getTemplateId() != null) {
                    List<BannerCta> cta = bannerDetails2.getBannerNodeInfo().getCta();
                    if (cta != null) {
                        Iterator<T> it = cta.iterator();
                        while (true) {
                            if (!it.hasNext()) {
                                obj = null;
                                break;
                            }
                            obj = it.next();
                            if (((BannerCta) obj).getAction() != null) {
                                break;
                            }
                        }
                        bannerCta = (BannerCta) obj;
                    } else {
                        bannerCta = null;
                    }
                    if (bannerCta != null) {
                    }
                }
                if (bannerDetails2.getBannerNodeInfo().getTemplateId() == null) {
                    BannerFallbackDetails bannerFallbackDetails = bannerDetails2.getBannerNodeInfo().getBannerFallbackDetails();
                    if ((bannerFallbackDetails != null ? bannerFallbackDetails.getAction() : null) != null) {
                    }
                }
            }
            arrayList2.add(obj3);
        }
        return CollectionsKt.H0(arrayList2, new Comparator() {
            @Override
            public final int compare(T t, T t2) {
                return ComparisonsKt.d(((BannerDetails) t).getBannerListings().getPriority(), ((BannerDetails) t2).getBannerListings().getPriority());
            }
        });
    }

    public final List<BannerCondition> getConditionsList() {
        return this.conditionsList;
    }
}