232 lines
4.9 KiB
Smali
232 lines
4.9 KiB
Smali
.class public final Landroidx/core/util/Preconditions;
|
|
.super Ljava/lang/Object;
|
|
.source "Preconditions.java"
|
|
|
|
|
|
# direct methods
|
|
.method private constructor <init>()V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static checkArgument(Z)V
|
|
.locals 0
|
|
|
|
if-eqz p0, :cond_0
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
new-instance p0, Ljava/lang/IllegalArgumentException;
|
|
|
|
invoke-direct {p0}, Ljava/lang/IllegalArgumentException;-><init>()V
|
|
|
|
throw p0
|
|
.end method
|
|
|
|
.method public static checkArgument(ZLjava/lang/Object;)V
|
|
.locals 0
|
|
|
|
if-eqz p0, :cond_0
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
new-instance p0, Ljava/lang/IllegalArgumentException;
|
|
|
|
invoke-static {p1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-direct {p0, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p0
|
|
.end method
|
|
|
|
.method public static checkArgumentInRange(IIILjava/lang/String;)I
|
|
.locals 5
|
|
|
|
const/4 v0, 0x2
|
|
|
|
const/4 v1, 0x1
|
|
|
|
const/4 v2, 0x0
|
|
|
|
const/4 v3, 0x3
|
|
|
|
if-lt p0, p1, :cond_1
|
|
|
|
if-gt p0, p2, :cond_0
|
|
|
|
return p0
|
|
|
|
:cond_0
|
|
new-instance p0, Ljava/lang/IllegalArgumentException;
|
|
|
|
sget-object v4, Ljava/util/Locale;->US:Ljava/util/Locale;
|
|
|
|
new-array v3, v3, [Ljava/lang/Object;
|
|
|
|
aput-object p3, v3, v2
|
|
|
|
invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object p1
|
|
|
|
aput-object p1, v3, v1
|
|
|
|
invoke-static {p2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object p1
|
|
|
|
aput-object p1, v3, v0
|
|
|
|
const-string p1, "%s is out of range of [%d, %d] (too high)"
|
|
|
|
invoke-static {v4, p1, v3}, Ljava/lang/String;->format(Ljava/util/Locale;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-direct {p0, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p0
|
|
|
|
:cond_1
|
|
new-instance p0, Ljava/lang/IllegalArgumentException;
|
|
|
|
sget-object v4, Ljava/util/Locale;->US:Ljava/util/Locale;
|
|
|
|
new-array v3, v3, [Ljava/lang/Object;
|
|
|
|
aput-object p3, v3, v2
|
|
|
|
invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object p1
|
|
|
|
aput-object p1, v3, v1
|
|
|
|
invoke-static {p2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object p1
|
|
|
|
aput-object p1, v3, v0
|
|
|
|
const-string p1, "%s is out of range of [%d, %d] (too low)"
|
|
|
|
invoke-static {v4, p1, v3}, Ljava/lang/String;->format(Ljava/util/Locale;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-direct {p0, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p0
|
|
.end method
|
|
|
|
.method public static checkArgumentNonnegative(I)I
|
|
.locals 0
|
|
|
|
if-ltz p0, :cond_0
|
|
|
|
return p0
|
|
|
|
:cond_0
|
|
new-instance p0, Ljava/lang/IllegalArgumentException;
|
|
|
|
invoke-direct {p0}, Ljava/lang/IllegalArgumentException;-><init>()V
|
|
|
|
throw p0
|
|
.end method
|
|
|
|
.method public static checkArgumentNonnegative(ILjava/lang/String;)I
|
|
.locals 0
|
|
|
|
if-ltz p0, :cond_0
|
|
|
|
return p0
|
|
|
|
:cond_0
|
|
new-instance p0, Ljava/lang/IllegalArgumentException;
|
|
|
|
invoke-direct {p0, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p0
|
|
.end method
|
|
|
|
.method public static checkNotNull(Ljava/lang/Object;)Ljava/lang/Object;
|
|
.locals 0
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"<T:",
|
|
"Ljava/lang/Object;",
|
|
">(TT;)TT;"
|
|
}
|
|
.end annotation
|
|
|
|
if-eqz p0, :cond_0
|
|
|
|
return-object p0
|
|
|
|
:cond_0
|
|
new-instance p0, Ljava/lang/NullPointerException;
|
|
|
|
invoke-direct {p0}, Ljava/lang/NullPointerException;-><init>()V
|
|
|
|
throw p0
|
|
.end method
|
|
|
|
.method public static checkNotNull(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
.locals 0
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"<T:",
|
|
"Ljava/lang/Object;",
|
|
">(TT;",
|
|
"Ljava/lang/Object;",
|
|
")TT;"
|
|
}
|
|
.end annotation
|
|
|
|
if-eqz p0, :cond_0
|
|
|
|
return-object p0
|
|
|
|
:cond_0
|
|
new-instance p0, Ljava/lang/NullPointerException;
|
|
|
|
invoke-static {p1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-direct {p0, p1}, Ljava/lang/NullPointerException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p0
|
|
.end method
|
|
|
|
.method public static checkState(Z)V
|
|
.locals 1
|
|
|
|
const/4 v0, 0x0
|
|
|
|
invoke-static {p0, v0}, Landroidx/core/util/Preconditions;->checkState(ZLjava/lang/String;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static checkState(ZLjava/lang/String;)V
|
|
.locals 0
|
|
|
|
if-eqz p0, :cond_0
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
new-instance p0, Ljava/lang/IllegalStateException;
|
|
|
|
invoke-direct {p0, p1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p0
|
|
.end method
|