ResponseCommand.smali
.class public Lcom/sandboxol/common/command/ResponseCommand;
.super Ljava/lang/Object;
.source "ResponseCommand.java"
# annotations
.annotation system Ldalvik/annotation/Signature;
value = {
"<T:",
"Ljava/lang/Object;",
"R:",
"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/Func0;
.annotation system Ldalvik/annotation/Signature;
value = {
"Lrx/functions/Func0<",
"TR;>;"
}
.end annotation
.end field
.field private execute1:Lrx/functions/Func1;
.annotation system Ldalvik/annotation/Signature;
value = {
"Lrx/functions/Func1<",
"TT;TR;>;"
}
.end annotation
.end field
# direct methods
.method public constructor <init>(Lrx/functions/Func0;)V
.registers 2
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Lrx/functions/Func0<",
"TR;>;)V"
}
.end annotation
.line 1
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
.line 2
iput-object p1, p0, Lcom/sandboxol/common/command/ResponseCommand;->execute0:Lrx/functions/Func0;
return-void
.end method
.method public constructor <init>(Lrx/functions/Func0;Lrx/functions/Func0;)V
.registers 3
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Lrx/functions/Func0<",
"TR;>;",
"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/ResponseCommand;->execute0:Lrx/functions/Func0;
.line 7
iput-object p2, p0, Lcom/sandboxol/common/command/ResponseCommand;->canExecute0:Lrx/functions/Func0;
return-void
.end method
.method public constructor <init>(Lrx/functions/Func1;)V
.registers 2
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Lrx/functions/Func1<",
"TT;TR;>;)V"
}
.end annotation
.line 3
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
.line 4
iput-object p1, p0, Lcom/sandboxol/common/command/ResponseCommand;->execute1:Lrx/functions/Func1;
return-void
.end method
.method public constructor <init>(Lrx/functions/Func1;Lrx/functions/Func0;)V
.registers 3
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Lrx/functions/Func1<",
"TT;TR;>;",
"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/ResponseCommand;->execute1:Lrx/functions/Func1;
.line 10
iput-object p2, p0, Lcom/sandboxol/common/command/ResponseCommand;->canExecute0:Lrx/functions/Func0;
return-void
.end method
.method private canExecute0()Z
.registers 2
.line 1
iget-object v0, p0, Lcom/sandboxol/common/command/ResponseCommand;->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()Ljava/lang/Object;
.registers 2
.annotation system Ldalvik/annotation/Signature;
value = {
"()TR;"
}
.end annotation
.line 1
iget-object v0, p0, Lcom/sandboxol/common/command/ResponseCommand;->execute0:Lrx/functions/Func0;
if-eqz v0, :cond_11
invoke-direct {p0}, Lcom/sandboxol/common/command/ResponseCommand;->canExecute0()Z
move-result v0
if-eqz v0, :cond_11
.line 2
iget-object v0, p0, Lcom/sandboxol/common/command/ResponseCommand;->execute0:Lrx/functions/Func0;
invoke-interface {v0}, Lrx/functions/Func0;->call()Ljava/lang/Object;
move-result-object v0
return-object v0
:cond_11
const/4 v0, 0x0
return-object v0
.end method
.method public execute(Ljava/lang/Object;)Ljava/lang/Object;
.registers 3
.annotation system Ldalvik/annotation/Signature;
value = {
"(TT;)TR;"
}
.end annotation
.line 3
iget-object v0, p0, Lcom/sandboxol/common/command/ResponseCommand;->execute1:Lrx/functions/Func1;
if-eqz v0, :cond_11
invoke-direct {p0}, Lcom/sandboxol/common/command/ResponseCommand;->canExecute0()Z
move-result v0
if-eqz v0, :cond_11
.line 4
iget-object v0, p0, Lcom/sandboxol/common/command/ResponseCommand;->execute1:Lrx/functions/Func1;
invoke-interface {v0, p1}, Lrx/functions/Func1;->call(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object p1
return-object p1
:cond_11
const/4 p1, 0x0
return-object p1
.end method