GoogleErrorUtil.smali

.class public Lcom/tradplus/ads/google/GoogleErrorUtil;
.super Ljava/lang/Object;
.source "GoogleErrorUtil.java"


# direct methods
.method public constructor <init>()V
    .registers 1

    .line 1
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method public static getTradPlusErrorCode(Lcom/tradplus/ads/mobileads/TradPlusErrorCode;I)Lcom/tradplus/ads/mobileads/TradPlusErrorCode;
    .registers 3

    if-eqz p1, :cond_2a

    const/4 p0, 0x1

    if-eq p1, p0, :cond_22

    const/4 p0, 0x2

    if-eq p1, p0, :cond_1a

    const/4 p0, 0x3

    if-eq p1, p0, :cond_12

    .line 1
    sget-object p0, Lcom/tradplus/ads/mobileads/TradPlusErrorCode;->UNSPECIFIED:Lcom/tradplus/ads/mobileads/TradPlusErrorCode;

    const/4 v0, 0x0

    .line 2
    invoke-virtual {p0, v0}, Lcom/tradplus/ads/mobileads/TradPlusErrorCode;->setErrormessage(Ljava/lang/String;)V

    goto :goto_31

    .line 3
    :cond_12
    sget-object p0, Lcom/tradplus/ads/mobileads/TradPlusErrorCode;->NETWORK_NO_FILL:Lcom/tradplus/ads/mobileads/TradPlusErrorCode;

    const-string v0, "The ad request was successful, but no ad was returned due to lack of ad inventory."

    .line 4
    invoke-virtual {p0, v0}, Lcom/tradplus/ads/mobileads/TradPlusErrorCode;->setErrormessage(Ljava/lang/String;)V

    goto :goto_31

    .line 5
    :cond_1a
    sget-object p0, Lcom/tradplus/ads/mobileads/TradPlusErrorCode;->CONNECTION_ERROR:Lcom/tradplus/ads/mobileads/TradPlusErrorCode;

    const-string v0, "The ad request was unsuccessful due to network connectivity"

    .line 6
    invoke-virtual {p0, v0}, Lcom/tradplus/ads/mobileads/TradPlusErrorCode;->setErrormessage(Ljava/lang/String;)V

    goto :goto_31

    .line 7
    :cond_22
    sget-object p0, Lcom/tradplus/ads/mobileads/TradPlusErrorCode;->INVALID_PLACEMENTID:Lcom/tradplus/ads/mobileads/TradPlusErrorCode;

    const-string v0, "The ad unit ID was incorrect."

    .line 8
    invoke-virtual {p0, v0}, Lcom/tradplus/ads/mobileads/TradPlusErrorCode;->setErrormessage(Ljava/lang/String;)V

    goto :goto_31

    .line 9
    :cond_2a
    sget-object p0, Lcom/tradplus/ads/mobileads/TradPlusErrorCode;->NETWORK_INVALID_REQUEST:Lcom/tradplus/ads/mobileads/TradPlusErrorCode;

    const-string v0, "An invalid response was received from the ad server."

    .line 10
    invoke-virtual {p0, v0}, Lcom/tradplus/ads/mobileads/TradPlusErrorCode;->setErrormessage(Ljava/lang/String;)V

    .line 11
    :goto_31
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    const-string p1, ""

    invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object p1

    invoke-virtual {p0, p1}, Lcom/tradplus/ads/mobileads/TradPlusErrorCode;->setCode(Ljava/lang/String;)V

    return-object p0
.end method