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.net.QueryRewardEffectsResponse;
import java.util.ArrayList;
import java.util.List;

public class QueryRewardEffectsResponseTemplate extends QueryRewardEffectsResponse {
    public final transient QueryRewardEffectsResponse kQueryRewardEffectsResponse;
    public List<? extends Effect> rewardEffects;

    static {
        Covode.recordClassIndex(125444);
    }

    public QueryRewardEffectsResponseTemplate() {
        this((QueryRewardEffectsResponse) null, 1, (2HN) null);
    }

    public QueryRewardEffectsResponse getKQueryRewardEffectsResponse() {
        return this.kQueryRewardEffectsResponse;
    }

    public List<Effect> getRewardEffects() {
        List<com.ss.ugc.effectplatform.model.Effect> list;
        QueryRewardEffectsResponse kQueryRewardEffectsResponse2 = getKQueryRewardEffectsResponse();
        if (kQueryRewardEffectsResponse2 == null || (list = kQueryRewardEffectsResponse2.getReward_effects()) == null) {
            list = super.getReward_effects();
        }
        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 (kQueryRewardEffectsResponse2 != null) {
            kQueryRewardEffectsResponse2.setReward_effects(list2);
        }
        super.setReward_effects(list2);
        return list2;
    }

    public QueryRewardEffectsResponseTemplate(QueryRewardEffectsResponse queryRewardEffectsResponse) {
        super((List) null, 0, (String) null, false, 0, (List) null, 63, (2HN) null);
        this.kQueryRewardEffectsResponse = queryRewardEffectsResponse;
        this.rewardEffects = new ArrayList();
    }

    public void setRewardEffects(List<? extends Effect> list) {
        M12.LIZ(list);
        this.rewardEffects = list;
        QueryRewardEffectsResponse kQueryRewardEffectsResponse2 = getKQueryRewardEffectsResponse();
        if (kQueryRewardEffectsResponse2 != null) {
            kQueryRewardEffectsResponse2.setReward_effects(list);
        }
        super.setReward_effects(list);
    }

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