package com.ss.android.ugc.effectmanager.effect.model.template;

import X.2HN;
import X.9HM;
import X.M12;
import com.bytedance.covode.number.Covode;
import com.ss.android.ugc.effectmanager.effect.model.Effect;
import com.ss.ugc.effectplatform.model.CategoryEffectModel;
import com.ss.ugc.effectplatform.model.net.FetchHotEffectResponse;
import java.util.ArrayList;
import java.util.List;

public class FetchHotEffectResponseTemplate extends FetchHotEffectResponse {
    public final transient FetchHotEffectResponse kFetchHotModel;

    static {
        Covode.recordClassIndex(125437);
    }

    public FetchHotEffectResponseTemplate() {
        this((FetchHotEffectResponse) null, 1, (2HN) null);
    }

    public static class DataTemplate extends FetchHotEffectResponse.Data {
        public final transient FetchHotEffectResponse.Data kData;

        static {
            Covode.recordClassIndex(125438);
        }

        public DataTemplate() {
            this((FetchHotEffectResponse.Data) null, 1, (2HN) null);
        }

        public FetchHotEffectResponse.Data getKData() {
            return this.kData;
        }

        public DataTemplate(FetchHotEffectResponse.Data data) {
            super((CategoryEffectModel) null, (FetchHotEffectResponse.Extra) null, (List) null, 7, (2HN) null);
            this.kData = data;
        }

        /* JADX INFO: this call moved to the top of the method (can break code semantics) */
        public /* synthetic */ DataTemplate(FetchHotEffectResponse.Data data, int i, 2HN r4) {
            this((i & 1) != 0 ? null : data);
        }
    }

    public static class ExtraTemplate extends FetchHotEffectResponse.Extra {
        public final transient FetchHotEffectResponse.Extra kData;

        static {
            Covode.recordClassIndex(125439);
        }

        public ExtraTemplate() {
            this((FetchHotEffectResponse.Extra) null, 1, (2HN) null);
        }

        public FetchHotEffectResponse.Extra getKData() {
            return this.kData;
        }

        public ExtraTemplate(FetchHotEffectResponse.Extra extra) {
            super((String) null, (List) null, 3, (2HN) null);
            this.kData = extra;
        }

        /* JADX INFO: this call moved to the top of the method (can break code semantics) */
        public /* synthetic */ ExtraTemplate(FetchHotEffectResponse.Extra extra, int i, 2HN r4) {
            this((i & 1) != 0 ? null : extra);
        }
    }

    public FetchHotEffectResponse getKFetchHotModel() {
        return this.kFetchHotModel;
    }

    public List<Effect> getCollection() {
        List<com.ss.ugc.effectplatform.model.Effect> list;
        FetchHotEffectResponse kFetchHotModel2 = getKFetchHotModel();
        if (kFetchHotModel2 == null || (list = kFetchHotModel2.getCollection_list()) == null) {
            list = getCollection_list();
        }
        if (!(!list.isEmpty())) {
            return new ArrayList();
        }
        if (list.get(0) instanceof Effect) {
            return list;
        }
        ArrayList arrayList = new ArrayList(9HM.LIZ(list, 10));
        for (com.ss.ugc.effectplatform.model.Effect effect : list) {
            arrayList.add(new Effect(effect));
        }
        List<Effect> list2 = arrayList;
        if (kFetchHotModel2 != null) {
            kFetchHotModel2.setCollection_list(list2);
        }
        setCollection_list(list2);
        return list2;
    }

    public List<Effect> getEffects() {
        List<com.ss.ugc.effectplatform.model.Effect> list;
        FetchHotEffectResponse kFetchHotModel2 = getKFetchHotModel();
        if (kFetchHotModel2 == null || (list = kFetchHotModel2.getEffect_list()) == null) {
            list = getEffect_list();
        }
        if (!(!list.isEmpty())) {
            return new ArrayList();
        }
        if (list.get(0) instanceof Effect) {
            return list;
        }
        ArrayList arrayList = new ArrayList(9HM.LIZ(list, 10));
        for (com.ss.ugc.effectplatform.model.Effect effect : list) {
            arrayList.add(new Effect(effect));
        }
        List<Effect> list2 = arrayList;
        if (kFetchHotModel2 != null) {
            kFetchHotModel2.setEffect_list(list2);
        }
        setEffect_list(list2);
        return list2;
    }

    public FetchHotEffectResponseTemplate(FetchHotEffectResponse fetchHotEffectResponse) {
        super((FetchHotEffectResponse.Data) null, (String) null, 0, 7, (2HN) null);
        this.kFetchHotModel = fetchHotEffectResponse;
    }

    public void setEffects(List<? extends Effect> list) {
        M12.LIZ(list);
        FetchHotEffectResponse kFetchHotModel2 = getKFetchHotModel();
        if (kFetchHotModel2 != null) {
            kFetchHotModel2.setEffect_list(list);
        }
        setEffect_list(list);
    }

    /* JADX INFO: this call moved to the top of the method (can break code semantics) */
    public /* synthetic */ FetchHotEffectResponseTemplate(FetchHotEffectResponse fetchHotEffectResponse, int i, 2HN r4) {
        this((i & 1) != 0 ? null : fetchHotEffectResponse);
    }
}
