package com.ss.android.ugc.aweme.ecommerce.service.vo;

import X.B3G;
import X.C6235CTv;
import X.Lea;
import X.M12;
import android.os.Parcel;
import android.os.Parcelable;
import com.bytedance.covode.number.Covode;
import com.google.gson.a.c;
import java.net.URI;
import java.util.List;
import java.util.Objects;
import kotlin.h.b.n;
import kotlin.o.z;

public final class Image implements Parcelable {
    public static final Parcelable.Creator<Image> CREATOR = new C6235CTv();
    @c(LIZ = "height")
    public final Integer height;
    @c(LIZ = "mimetype")
    public final String mimetype;
    @c(LIZ = "thumb_uri")
    public final String thumbUri;
    @c(LIZ = "thumb_url_list")
    public List<String> thumbUrls;
    @c(LIZ = "uri")
    public final String uri;
    @c(LIZ = "url_list")
    public List<String> urls;
    @c(LIZ = "width")
    public final Integer width;

    static {
        Covode.recordClassIndex(72494);
    }

    public static /* synthetic */ Image copy$default(Image image, Integer num, Integer num2, String str, String str2, List<String> list, String str3, List<String> list2, int i, Object obj) {
        if ((i & 1) != 0) {
            num = image.width;
        }
        if ((i & 2) != 0) {
            num2 = image.height;
        }
        if ((i & 4) != 0) {
            str = image.mimetype;
        }
        if ((i & 8) != 0) {
            str2 = image.uri;
        }
        if ((i & 16) != 0) {
            list = image.urls;
        }
        if ((i & 32) != 0) {
            str3 = image.thumbUri;
        }
        if ((i & 64) != 0) {
            list2 = image.thumbUrls;
        }
        return image.copy(num, num2, str, str2, list, str3, list2);
    }

    private Object[] getObjects() {
        return new Object[]{this.width, this.height, this.mimetype, this.uri, this.urls, this.thumbUri, this.thumbUrls};
    }

    public final Image copy(Integer num, Integer num2, String str, String str2, List<String> list, String str3, List<String> list2) {
        return new Image(num, num2, str, str2, list, str3, list2);
    }

    public final int describeContents() {
        return 0;
    }

    public final boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (!(obj instanceof Image)) {
            return false;
        }
        return M12.LIZ(((Image) obj).getObjects(), getObjects());
    }

    public final int hashCode() {
        return Objects.hash(getObjects());
    }

    public final String toString() {
        return M12.LIZ("Image:%s,%s,%s,%s,%s,%s,%s", getObjects());
    }

    public final void writeToParcel(Parcel parcel, int i) {
        M12.LIZ(parcel);
        Integer num = this.width;
        if (num != null) {
            parcel.writeInt(1);
            parcel.writeInt(num.intValue());
        } else {
            parcel.writeInt(0);
        }
        Integer num2 = this.height;
        if (num2 != null) {
            parcel.writeInt(1);
            parcel.writeInt(num2.intValue());
        } else {
            parcel.writeInt(0);
        }
        parcel.writeString(this.mimetype);
        parcel.writeString(this.uri);
        parcel.writeStringList(this.urls);
        parcel.writeString(this.thumbUri);
        parcel.writeStringList(this.thumbUrls);
    }

    public final Integer getHeight() {
        return this.height;
    }

    public final String getMimetype() {
        return this.mimetype;
    }

    public final String getThumbUri() {
        return this.thumbUri;
    }

    public final List<String> getThumbUrls() {
        return this.thumbUrls;
    }

    public final String getUri() {
        return this.uri;
    }

    public final List<String> getUrls() {
        return this.urls;
    }

    public final Integer getWidth() {
        return this.width;
    }

    private final B3G toThumbImageUrlModel() {
        return new B3G(this.thumbUrls);
    }

    public final B3G toImageUrlModel() {
        return new B3G(this.urls);
    }

    public final String getHost() {
        String str;
        List<String> list = this.urls;
        if (list == null || (str = (String) Lea.LJIIIIZZ(list)) == null) {
            return null;
        }
        URI create = URI.create(str);
        n.LIZIZ(create, "");
        return create.getHost();
    }

    public final B3G toThumbFirstImageUrlModel() {
        List<String> list = this.thumbUrls;
        if (list == null || list.isEmpty()) {
            return toImageUrlModel();
        }
        return toThumbImageUrlModel();
    }

    public final String getSuffix() {
        String str;
        String str2;
        List<String> list = this.urls;
        if (list == null || (str = (String) Lea.LJIIIIZZ(list)) == null || (str2 = this.uri) == null || str2.length() <= 0) {
            return null;
        }
        return (String) Lea.LIZIZ(z.LIZ(str, new String[]{str2}, 0, 6), 1);
    }

    public final void setThumbUrls(List<String> list) {
        this.thumbUrls = list;
    }

    public final void setUrls(List<String> list) {
        this.urls = list;
    }

    public Image(Integer num, Integer num2, String str, String str2, List<String> list, String str3, List<String> list2) {
        this.width = num;
        this.height = num2;
        this.mimetype = str;
        this.uri = str2;
        this.urls = list;
        this.thumbUri = str3;
        this.thumbUrls = list2;
    }
}
