package com.bytedance.gift.render.api.model;

import android.os.Parcel;
import android.os.Parcelable;
import com.bytedance.covode.number.Covode;
import com.google.gson.a.c;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class ImageModel implements Parcelable {
    public static final Parcelable.Creator<ImageModel> CREATOR = new Parcelable.Creator<ImageModel>() {
        static {
            Covode.recordClassIndex(26722);
        }

        public final /* bridge */ /* synthetic */ Object[] newArray(int i) {
            return new ImageModel[i];
        }

        public final /* synthetic */ Object createFromParcel(Parcel parcel) {
            return new ImageModel(parcel);
        }
    };
    @c(LIZ = "avg_color")
    public String avgColor;
    @c(LIZ = "content")
    public Content content;
    @c(LIZ = "height")
    public int height;
    @c(LIZ = "image_type")
    public int imageType;
    @c(LIZ = "is_animated")
    public boolean isAnimated;
    public boolean isFeedCandidate;
    public boolean isLoaded;
    public boolean isMonitored;
    @c(LIZ = "uri")
    public String mUri;
    @c(LIZ = "url_list")
    public List<String> mUrls = new ArrayList();
    @c(LIZ = "open_web_url")
    public String schema;
    @c(LIZ = "width")
    public int width;

    public int describeContents() {
        return 0;
    }

    public static class Content implements Parcelable {
        public static final Parcelable.Creator<Content> CREATOR = new Parcelable.Creator<Content>() {
            static {
                Covode.recordClassIndex(26724);
            }

            public final /* bridge */ /* synthetic */ Object[] newArray(int i) {
                return new Content[i];
            }

            public final /* synthetic */ Object createFromParcel(Parcel parcel) {
                return new Content(parcel);
            }
        };
        @c(LIZ = "name")
        public String LIZ;
        @c(LIZ = "font_color")
        public String LIZIZ;
        @c(LIZ = "level")
        public long LIZJ;

        public int describeContents() {
            return 0;
        }

        public Content() {
        }

        static {
            Covode.recordClassIndex(26723);
        }

        public Content(Parcel parcel) {
            this.LIZ = parcel.readString();
            this.LIZIZ = parcel.readString();
            this.LIZJ = parcel.readLong();
        }

        public void writeToParcel(Parcel parcel, int i) {
            parcel.writeString(this.LIZ);
            parcel.writeString(this.LIZIZ);
            parcel.writeLong(this.LIZJ);
        }
    }

    public String getAvgColor() {
        return this.avgColor;
    }

    public int getHeight() {
        return this.height;
    }

    @c(LIZ = "content")
    public Content getImageContent() {
        return this.content;
    }

    @c(LIZ = "image_type")
    public int getImageType() {
        return this.imageType;
    }

    @c(LIZ = "open_web_url")
    public String getSchema() {
        return this.schema;
    }

    @c(LIZ = "uri")
    public String getUri() {
        return this.mUri;
    }

    @c(LIZ = "url_list")
    public List<String> getUrls() {
        return this.mUrls;
    }

    public int getWidth() {
        return this.width;
    }

    @c(LIZ = "is_animated")
    public boolean isAnimated() {
        return this.isAnimated;
    }

    public boolean isFeedCandidate() {
        return this.isFeedCandidate;
    }

    public boolean isLoaded() {
        return this.isLoaded;
    }

    public boolean isMonitored() {
        return this.isMonitored;
    }

    static {
        Covode.recordClassIndex(26721);
    }

    public ImageModel() {
    }

    public int hashCode() {
        return hash(this.avgColor, this.mUri, this.mUrls, Integer.valueOf(this.width), Integer.valueOf(this.height));
    }

    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{\"uri\":\"");
        String str = this.mUri;
        String str2 = "";
        if (str == null) {
            str = str2;
        }
        sb.append(str);
        sb.append("\",\"image_type\":\"");
        String str3 = this.schema;
        if (str3 != null) {
            str2 = str3;
        }
        sb.append(str2);
        sb.append("\",\"url_list\":[");
        List<String> list = this.mUrls;
        if (list != null) {
            int size = list.size();
            for (int i = 0; i < size; i++) {
                sb.append("\"");
                sb.append(this.mUrls.get(i));
                sb.append("\"");
                if (i != size - 1) {
                    sb.append(",");
                }
            }
        }
        sb.append("]}");
        return sb.toString();
    }

    @c(LIZ = "is_animated")
    public void setAnimated(boolean z) {
        this.isAnimated = z;
    }

    public void setAvgColor(String str) {
        this.avgColor = str;
    }

    @c(LIZ = "content")
    public void setContent(Content content2) {
        this.content = content2;
    }

    public void setFeedCandidate(boolean z) {
        this.isFeedCandidate = z;
    }

    public void setHeight(int i) {
        this.height = i;
    }

    @c(LIZ = "image_type")
    public void setImageType(int i) {
        this.imageType = i;
    }

    public void setLoaded(boolean z) {
        this.isLoaded = z;
    }

    public void setMonitored(boolean z) {
        this.isMonitored = z;
    }

    @c(LIZ = "open_web_url")
    public void setSchema(String str) {
        this.schema = str;
    }

    @c(LIZ = "uri")
    public void setUri(String str) {
        this.mUri = str;
    }

    @c(LIZ = "url_list")
    public void setUrls(List<String> list) {
        this.mUrls = list;
    }

    public void setWidth(int i) {
        this.width = i;
    }

    public static ImageModel genBy(String str) {
        ImageModel imageModel = new ImageModel();
        imageModel.setUrls(Collections.singletonList(str));
        return imageModel;
    }

    public static int hash(Object... objArr) {
        int hashCode;
        if (objArr == null) {
            return 0;
        }
        int i = 1;
        for (Object obj : objArr) {
            int i2 = i * 31;
            if (obj == null) {
                hashCode = 0;
            } else {
                hashCode = obj.hashCode();
            }
            i = i2 + hashCode;
        }
        return i;
    }

    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj != null && getClass() == obj.getClass()) {
            ImageModel imageModel = (ImageModel) obj;
            if (this.width != imageModel.width || this.height != imageModel.height || !equals(this.avgColor, imageModel.avgColor) || !equals(this.mUri, imageModel.mUri) || !equals(this.mUrls, imageModel.mUrls)) {
                return false;
            }
            return true;
        }
        return false;
    }

    public ImageModel(Parcel parcel) {
        boolean z;
        boolean z2;
        boolean z3;
        this.mUri = parcel.readString();
        this.mUrls = parcel.createStringArrayList();
        this.width = parcel.readInt();
        this.height = parcel.readInt();
        this.schema = parcel.readString();
        this.imageType = parcel.readInt();
        this.content = (Content) parcel.readParcelable(Content.class.getClassLoader());
        boolean z4 = true;
        if (parcel.readByte() != 0) {
            z = true;
        } else {
            z = false;
        }
        this.isAnimated = z;
        if (parcel.readByte() != 0) {
            z2 = true;
        } else {
            z2 = false;
        }
        this.isLoaded = z2;
        if (parcel.readByte() != 0) {
            z3 = true;
        } else {
            z3 = false;
        }
        this.isMonitored = z3;
        this.isFeedCandidate = parcel.readByte() == 0 ? false : z4;
    }

    public static boolean equals(Object obj, Object obj2) {
        if (obj == obj2) {
            return true;
        }
        if (obj == null || !obj.equals(obj2)) {
            return false;
        }
        return true;
    }

    public ImageModel(String str, List<String> list) {
        this.mUri = str;
        this.mUrls = list;
    }

    public void writeToParcel(Parcel parcel, int i) {
        parcel.writeString(this.mUri);
        parcel.writeStringList(this.mUrls);
        parcel.writeInt(this.width);
        parcel.writeInt(this.height);
        parcel.writeString(this.schema);
        parcel.writeInt(this.imageType);
        parcel.writeParcelable(this.content, i);
        parcel.writeByte(this.isAnimated ? (byte) 1 : 0);
        parcel.writeByte(this.isLoaded ? (byte) 1 : 0);
        parcel.writeByte(this.isMonitored ? (byte) 1 : 0);
        parcel.writeByte(this.isFeedCandidate ? (byte) 1 : 0);
    }

    public ImageModel(String str, List<String> list, String str2) {
        this.mUri = str;
        this.mUrls = list;
        this.schema = str2;
    }
}
