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.ResourceListModel;
import com.ss.ugc.effectplatform.model.ResourceListModel;
import java.util.ArrayList;
import java.util.List;

public class ResourceListModelTemplate extends ResourceListModel {
    public String iconUri;
    public final transient ResourceListModel kResourceModel;
    public String param;
    public List<ResourceListModel.ResourceListBean> resourceList;
    public List<String> urlPrefix;

    static {
        Covode.recordClassIndex(125445);
    }

    public ResourceListModelTemplate() {
        this((com.ss.ugc.effectplatform.model.ResourceListModel) null, 1, (2HN) null);
    }

    public static class ResourceListBeanTemplate extends ResourceListModel.ResourceListBean {
        public final transient ResourceListModel.ResourceListBean kResourceBean;
        public String resourceUrl;

        static {
            Covode.recordClassIndex(125446);
        }

        public ResourceListBeanTemplate() {
            this((ResourceListModel.ResourceListBean) null, 1, (2HN) null);
        }

        public ResourceListModel.ResourceListBean getKResourceBean() {
            return this.kResourceBean;
        }

        public String getResourceUrl() {
            String resource_uri;
            ResourceListModel.ResourceListBean kResourceBean2 = getKResourceBean();
            if (kResourceBean2 == null || (resource_uri = kResourceBean2.getResource_uri()) == null) {
                return super.getResource_uri();
            }
            return resource_uri;
        }

        public ResourceListBeanTemplate(ResourceListModel.ResourceListBean resourceListBean) {
            super((String) null, (String) null, (String) null, 7, (2HN) null);
            this.kResourceBean = resourceListBean;
        }

        public void setResourceUrl(String str) {
            this.resourceUrl = str;
            ResourceListModel.ResourceListBean kResourceBean2 = getKResourceBean();
            if (kResourceBean2 != null) {
                kResourceBean2.setResource_uri(str);
            }
            super.setResource_uri(str);
        }

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

    public com.ss.ugc.effectplatform.model.ResourceListModel getKResourceModel() {
        return this.kResourceModel;
    }

    public String getIconUri() {
        String icon_uri;
        com.ss.ugc.effectplatform.model.ResourceListModel kResourceModel2 = getKResourceModel();
        if (kResourceModel2 == null || (icon_uri = kResourceModel2.getIcon_uri()) == null) {
            return super.getIcon_uri();
        }
        return icon_uri;
    }

    public String getParam() {
        String params;
        com.ss.ugc.effectplatform.model.ResourceListModel kResourceModel2 = getKResourceModel();
        if (kResourceModel2 == null || (params = kResourceModel2.getParams()) == null) {
            return super.getParams();
        }
        return params;
    }

    public List<String> getUrlPrefix() {
        List<String> url_prefix;
        com.ss.ugc.effectplatform.model.ResourceListModel kResourceModel2 = getKResourceModel();
        if (kResourceModel2 == null || (url_prefix = kResourceModel2.getUrl_prefix()) == null) {
            return super.getUrl_prefix();
        }
        return url_prefix;
    }

    public List<ResourceListModel.ResourceListBean> getResourceList() {
        List<ResourceListModel.ResourceListBean> list;
        com.ss.ugc.effectplatform.model.ResourceListModel kResourceModel2 = getKResourceModel();
        if (kResourceModel2 == null || (list = kResourceModel2.getResource_list()) == null) {
            list = super.getResource_list();
        }
        if (!(!list.isEmpty())) {
            return new ArrayList();
        }
        if (list.get(0) instanceof ResourceListModel.ResourceListBean) {
            return list;
        }
        ArrayList arrayList = new ArrayList(9HM.LIZ(list, 10));
        for (ResourceListModel.ResourceListBean resourceListBean : list) {
            arrayList.add(new ResourceListModel.ResourceListBean(resourceListBean));
        }
        List<ResourceListModel.ResourceListBean> list2 = arrayList;
        if (kResourceModel2 != null) {
            kResourceModel2.setResource_list(list2);
        }
        super.setResource_list(list2);
        return list2;
    }

    public void setIconUri(String str) {
        this.iconUri = str;
        com.ss.ugc.effectplatform.model.ResourceListModel kResourceModel2 = getKResourceModel();
        if (kResourceModel2 != null) {
            kResourceModel2.setIcon_uri(str);
        }
        super.setIcon_uri(str);
    }

    public void setParam(String str) {
        this.param = str;
        com.ss.ugc.effectplatform.model.ResourceListModel kResourceModel2 = getKResourceModel();
        if (kResourceModel2 != null) {
            kResourceModel2.setParams(str);
        }
        super.setParams(str);
    }

    public ResourceListModelTemplate(com.ss.ugc.effectplatform.model.ResourceListModel resourceListModel) {
        super((List) null, (List) null, (String) null, (String) null, 15, (2HN) null);
        this.kResourceModel = resourceListModel;
        this.resourceList = new ArrayList();
        this.urlPrefix = new ArrayList();
    }

    public void setResourceList(List<ResourceListModel.ResourceListBean> list) {
        M12.LIZ(list);
        this.resourceList = list;
        com.ss.ugc.effectplatform.model.ResourceListModel kResourceModel2 = getKResourceModel();
        if (kResourceModel2 != null) {
            kResourceModel2.setResource_list(list);
        }
        super.setResource_list(list);
    }

    public void setUrlPrefix(List<String> list) {
        M12.LIZ(list);
        this.urlPrefix = list;
        com.ss.ugc.effectplatform.model.ResourceListModel kResourceModel2 = getKResourceModel();
        if (kResourceModel2 != null) {
            kResourceModel2.setUrl_prefix(list);
        }
        super.setUrl_prefix(list);
    }

    /* JADX INFO: this call moved to the top of the method (can break code semantics) */
    public /* synthetic */ ResourceListModelTemplate(com.ss.ugc.effectplatform.model.ResourceListModel resourceListModel, int i, 2HN r4) {
        this((i & 1) != 0 ? null : resourceListModel);
    }
}
