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

public class EffectCategoryResponseTemplate extends EffectCategoryResponse {
    public List<? extends Effect> collectionEffect;
    public Effect frontEffect;
    public boolean isDefault;
    public final transient EffectCategoryResponse kCategoryResponse;
    public Effect rearEffect;
    public String tagsUpdateTime;
    public List<? extends Effect> totalEffects;

    static {
        Covode.recordClassIndex(125427);
    }

    public EffectCategoryResponseTemplate() {
        this((EffectCategoryResponse) null, 1, (2HN) null);
    }

    public EffectCategoryResponse getKCategoryResponse() {
        return this.kCategoryResponse;
    }

    public boolean isDefault() {
        EffectCategoryResponse kCategoryResponse2 = getKCategoryResponse();
        if (kCategoryResponse2 != null) {
            return kCategoryResponse2.is_default();
        }
        return super.is_default();
    }

    public Effect getFrontEffect() {
        com.ss.ugc.effectplatform.model.Effect effect;
        EffectCategoryResponse kCategoryResponse2 = getKCategoryResponse();
        if (kCategoryResponse2 == null || (effect = kCategoryResponse2.getFront_effect()) == null) {
            effect = super.getFront_effect();
        }
        return new Effect(effect);
    }

    public Effect getRearEffect() {
        com.ss.ugc.effectplatform.model.Effect effect;
        EffectCategoryResponse kCategoryResponse2 = getKCategoryResponse();
        if (kCategoryResponse2 == null || (effect = kCategoryResponse2.getRear_effect()) == null) {
            effect = super.getRear_effect();
        }
        return new Effect(effect);
    }

    public String getTagsUpdateTime() {
        String tags_update_time;
        EffectCategoryResponse kCategoryResponse2 = getKCategoryResponse();
        if (kCategoryResponse2 == null || (tags_update_time = kCategoryResponse2.getTags_update_time()) == null) {
            return super.getTags_update_time();
        }
        return tags_update_time;
    }

    public List<Effect> getCollectionEffect() {
        List<com.ss.ugc.effectplatform.model.Effect> list;
        EffectCategoryResponse kCategoryResponse2 = getKCategoryResponse();
        if (kCategoryResponse2 == null || (list = kCategoryResponse2.getCollection_effect()) == null) {
            list = super.getCollection_effect();
        }
        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 (kCategoryResponse2 != null) {
            kCategoryResponse2.setCollection_effect(list2);
        }
        super.setCollection_effect(list2);
        return list2;
    }

    public List<Effect> getTotalEffects() {
        List<com.ss.ugc.effectplatform.model.Effect> list;
        EffectCategoryResponse kCategoryResponse2 = getKCategoryResponse();
        if (kCategoryResponse2 == null || (list = kCategoryResponse2.getTotal_effects()) == null) {
            list = super.getTotal_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 (kCategoryResponse2 != null) {
            kCategoryResponse2.setTotal_effects(list2);
        }
        super.setTotal_effects(list2);
        return list2;
    }

    public void setDefault(boolean z) {
        this.isDefault = z;
        EffectCategoryResponse kCategoryResponse2 = getKCategoryResponse();
        if (kCategoryResponse2 != null) {
            kCategoryResponse2.set_default(z);
        }
        super.set_default(z);
    }

    public void setFrontEffect(Effect effect) {
        this.frontEffect = effect;
        EffectCategoryResponse kCategoryResponse2 = getKCategoryResponse();
        if (kCategoryResponse2 != null) {
            kCategoryResponse2.setFront_effect(effect);
        }
        super.setFront_effect(effect);
    }

    public void setRearEffect(Effect effect) {
        this.rearEffect = effect;
        EffectCategoryResponse kCategoryResponse2 = getKCategoryResponse();
        if (kCategoryResponse2 != null) {
            kCategoryResponse2.setRear_effect(effect);
        }
        super.setRear_effect(effect);
    }

    public void setTagsUpdateTime(String str) {
        this.tagsUpdateTime = str;
        EffectCategoryResponse kCategoryResponse2 = getKCategoryResponse();
        if (kCategoryResponse2 != null) {
            kCategoryResponse2.setTags_update_time(str);
        }
        super.setTags_update_time(str);
    }

    public void setCollectionEffect(List<? extends Effect> list) {
        M12.LIZ(list);
        this.collectionEffect = list;
        EffectCategoryResponse kCategoryResponse2 = getKCategoryResponse();
        if (kCategoryResponse2 != null) {
            kCategoryResponse2.setCollection_effect(list);
        }
        super.setCollection_effect(list);
    }

    public void setTotalEffects(List<? extends Effect> list) {
        M12.LIZ(list);
        this.totalEffects = list;
        EffectCategoryResponse kCategoryResponse2 = getKCategoryResponse();
        if (kCategoryResponse2 != null) {
            kCategoryResponse2.setTotal_effects(list);
        }
        super.setTotal_effects(list);
    }

    /* JADX INFO: super call moved to the top of the method (can break code semantics) */
    public EffectCategoryResponseTemplate(EffectCategoryResponse effectCategoryResponse) {
        super((String) null, (String) null, (String) null, (String) null, (String) null, (com.ss.ugc.effectplatform.model.Effect) null, (com.ss.ugc.effectplatform.model.Effect) null, (List) null, (List) null, (String) null, (List) null, false, (String) null, 8191, (2HN) null);
        this.kCategoryResponse = effectCategoryResponse;
        this.totalEffects = new ArrayList();
        this.collectionEffect = new ArrayList();
    }

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