package AdThreeAnalysis;

import org.apache.http.util.TextUtils;

import StructuralClass.DebugInfo;
import StructuralClass.TempletItem;
import StructuralClass.TempletLine;
import TX_OtherClass.JceStruct;
import TX_OtherClass.c;

public class ONAViewTools {
    public class ItemHolder implements a {
        public Object data;
        public DebugInfo debugInfo;
        public String groupId;
        public long increaseId;
        public int viewType;
        


        public ItemHolder() {
           
        }

        public Object getData() {
            return this.data;
        }

        public String getGroupId() {
            return this.groupId;
        }

        public int getItemId() {
            int v0 = this.data == null ? -1 : this.data.hashCode();
            return v0;
        }

        public int getViewType() {
            return this.viewType;
        }
    }
    public ONAViewTools() {
        super();
    }
    public static ONAAdPoster builderItemHolder(TempletLine arg9) {
    	ONAAdPoster v1 = null;
        if(arg9 != null && arg9.item != null && arg9.item.data != null) {
            TempletItem v0 = arg9.item;
            int v2 = v0.itemType;
            byte[] v3 = v0.data;
            DebugInfo v4 = v0.debugInfo;
            long v6 = arg9.increaseId;
            EONAViewType v0_1 = EONAViewType.convert(v2);
            if(v0_1 != null) {
                try {
                    JceStruct v3_1 = ONAViewTools.builderJecData(EONAViewType.class.getPackage().getName() + "." + v0_1.toString().substring(4), v3);
                    if(null != v3_1) {
                    	
                        return (ONAAdPoster)v3_1;
                    }
                    else {
                        return v1;
                    }
                }
                catch(Exception v0_2) {
                   
                    return v1;
                }
            }
            else {
                return v1;
            }
        }

        return v1;
    }
    
   /* public static JceStruct builderJecData(String arg4, byte[] arg5) {
        JceStruct v0_2 = null;
        JceStruct v1 = null;
        arg4 = "AdThreeAnalysis.ONAAdPoster";
        if(!TextUtils.isEmpty(((CharSequence)arg4)) && arg5 != null) {
            try {
                Object v0_1 = Class.forName(arg4).newInstance();
                c v2 = new c(arg5);
                v2.a("UTF-8");
                ((JceStruct)v0_1).readFrom(v2);
            }
            catch(Exception v0) {
                v0_2 = v1;
            }
        }
        else {
            v0_2 = v1;
        }

        return v0_2;
    }*/

    public static JceStruct builderJecData(String str, byte[] bArr) {
        if (TextUtils.isEmpty(str) || bArr == null) {
            return null;
        }
        try {
        	str = "AdThreeAnalysis.ONAAdPoster";
            JceStruct jceStruct = (JceStruct) Class.forName(str).newInstance();
            c cVar = new c(bArr);
            cVar.a("UTF-8");
            jceStruct.readFrom(cVar);
            return jceStruct;
        } catch (Exception e) {
           
            return null;
        }
    }

    

}
