ReplyCommand.smali

.class public Lcom/sandboxol/common/command/ReplyCommand;
.super Ljava/lang/Object;
.source "ReplyCommand.java"


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


# instance fields
.field private canExecute0:Lrx/functions/Func0;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Lrx/functions/Func0<",
            "Ljava/lang/Boolean;",
            ">;"
        }
    .end annotation
.end field

.field private execute0:Lrx/functions/Action0;

.field private execute1:Lrx/functions/Action1;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Lrx/functions/Action1<",
            "TT;>;"
        }
    .end annotation
.end field


# direct methods
.method public constructor <init>(Lrx/functions/Action0;)V
    .registers 2

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

    .line 2
    iput-object p1, p0, Lcom/sandboxol/common/command/ReplyCommand;->execute0:Lrx/functions/Action0;

    return-void
.end method

.method public constructor <init>(Lrx/functions/Action0;Lrx/functions/Func0;)V
    .registers 3
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lrx/functions/Action0;",
            "Lrx/functions/Func0<",
            "Ljava/lang/Boolean;",
            ">;)V"
        }
    .end annotation

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

    .line 6
    iput-object p1, p0, Lcom/sandboxol/common/command/ReplyCommand;->execute0:Lrx/functions/Action0;

    .line 7
    iput-object p2, p0, Lcom/sandboxol/common/command/ReplyCommand;->canExecute0:Lrx/functions/Func0;

    return-void
.end method

.method public constructor <init>(Lrx/functions/Action1;)V
    .registers 2
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lrx/functions/Action1<",
            "TT;>;)V"
        }
    .end annotation

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

    .line 4
    iput-object p1, p0, Lcom/sandboxol/common/command/ReplyCommand;->execute1:Lrx/functions/Action1;

    return-void
.end method

.method public constructor <init>(Lrx/functions/Action1;Lrx/functions/Func0;)V
    .registers 3
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lrx/functions/Action1<",
            "TT;>;",
            "Lrx/functions/Func0<",
            "Ljava/lang/Boolean;",
            ">;)V"
        }
    .end annotation

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

    .line 9
    iput-object p1, p0, Lcom/sandboxol/common/command/ReplyCommand;->execute1:Lrx/functions/Action1;

    .line 10
    iput-object p2, p0, Lcom/sandboxol/common/command/ReplyCommand;->canExecute0:Lrx/functions/Func0;

    return-void
.end method

.method private canExecute0()Z
    .registers 2

    .line 1
    iget-object v0, p0, Lcom/sandboxol/common/command/ReplyCommand;->canExecute0:Lrx/functions/Func0;

    if-nez v0, :cond_6

    const/4 v0, 0x1

    return v0

    .line 2
    :cond_6
    invoke-interface {v0}, Lrx/functions/Func0;->call()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/Boolean;

    invoke-virtual {v0}, Ljava/lang/Boolean;->booleanValue()Z

    move-result v0

    return v0
.end method


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

    .line 1
    iget-object v0, p0, Lcom/sandboxol/common/command/ReplyCommand;->execute0:Lrx/functions/Action0;

    if-eqz v0, :cond_f

    invoke-direct {p0}, Lcom/sandboxol/common/command/ReplyCommand;->canExecute0()Z

    move-result v0

    if-eqz v0, :cond_f

    .line 2
    iget-object v0, p0, Lcom/sandboxol/common/command/ReplyCommand;->execute0:Lrx/functions/Action0;

    invoke-interface {v0}, Lrx/functions/Action0;->call()V

    :cond_f
    return-void
.end method

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

    .line 3
    iget-object v0, p0, Lcom/sandboxol/common/command/ReplyCommand;->execute1:Lrx/functions/Action1;

    if-eqz v0, :cond_f

    invoke-direct {p0}, Lcom/sandboxol/common/command/ReplyCommand;->canExecute0()Z

    move-result v0

    if-eqz v0, :cond_f

    .line 4
    iget-object v0, p0, Lcom/sandboxol/common/command/ReplyCommand;->execute1:Lrx/functions/Action1;

    invoke-interface {v0, p1}, Lrx/functions/Action1;->call(Ljava/lang/Object;)V

    :cond_f
    return-void
.end method