DaoSubscribe.smali

.class public Lcom/sandboxol/common/base/dao/DaoSubscribe;
.super Lrx/Subscriber;
.source "DaoSubscribe.java"


# annotations
.annotation system Ldalvik/annotation/Signature;
    value = {
        "<T:",
        "Ljava/lang/Object;",
        ">",
        "Lrx/Subscriber<",
        "TT;>;"
    }
.end annotation


# instance fields
.field private listener:Lcom/sandboxol/common/base/web/OnResponseListener;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Lcom/sandboxol/common/base/web/OnResponseListener<",
            "TT;>;"
        }
    .end annotation
.end field


# direct methods
.method public constructor <init>(Lcom/sandboxol/common/base/web/OnResponseListener;)V
    .registers 2
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lcom/sandboxol/common/base/web/OnResponseListener<",
            "TT;>;)V"
        }
    .end annotation

    .line 1
    invoke-direct {p0}, Lrx/Subscriber;-><init>()V

    .line 2
    iput-object p1, p0, Lcom/sandboxol/common/base/dao/DaoSubscribe;->listener:Lcom/sandboxol/common/base/web/OnResponseListener;

    return-void
.end method


# virtual methods
.method public onCompleted()V
    .registers 2

    .line 1
    sget-object v0, Ljava/lang/System;->out:Ljava/io/PrintStream;

    invoke-virtual {v0}, Ljava/io/PrintStream;->println()V

    return-void
.end method

.method public onError(Ljava/lang/Throwable;)V
    .registers 3

    .line 1
    iget-object v0, p0, Lcom/sandboxol/common/base/dao/DaoSubscribe;->listener:Lcom/sandboxol/common/base/web/OnResponseListener;

    if-eqz v0, :cond_25

    if-eqz p1, :cond_1e

    .line 2
    invoke-virtual {p1}, Ljava/lang/Throwable;->getCause()Ljava/lang/Throwable;

    move-result-object v0

    instance-of v0, v0, Lcom/sandboxol/common/base/dao/DaoException;

    if-eqz v0, :cond_1e

    .line 3
    iget-object v0, p0, Lcom/sandboxol/common/base/dao/DaoSubscribe;->listener:Lcom/sandboxol/common/base/web/OnResponseListener;

    invoke-virtual {p1}, Ljava/lang/Throwable;->getCause()Ljava/lang/Throwable;

    move-result-object p1

    check-cast p1, Lcom/sandboxol/common/base/dao/DaoException;

    invoke-virtual {p1}, Lcom/sandboxol/common/base/dao/DaoException;->getCode()I

    move-result p1

    invoke-virtual {v0, p1}, Lcom/sandboxol/common/base/web/OnResponseListener;->onServerError(I)V

    goto :goto_25

    .line 4
    :cond_1e
    iget-object p1, p0, Lcom/sandboxol/common/base/dao/DaoSubscribe;->listener:Lcom/sandboxol/common/base/web/OnResponseListener;

    const/16 v0, 0x2712

    invoke-virtual {p1, v0}, Lcom/sandboxol/common/base/web/OnResponseListener;->onServerError(I)V

    :cond_25
    :goto_25
    return-void
.end method

.method public onNext(Ljava/lang/Object;)V
    .registers 3
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(TT;)V"
        }
    .end annotation

    .line 1
    iget-object v0, p0, Lcom/sandboxol/common/base/dao/DaoSubscribe;->listener:Lcom/sandboxol/common/base/web/OnResponseListener;

    if-eqz v0, :cond_7

    .line 2
    invoke-virtual {v0, p1}, Lcom/sandboxol/common/base/web/OnResponseListener;->onSuccess(Ljava/lang/Object;)V

    :cond_7
    return-void
.end method