今奥全景相机
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

574 lines
12 KiB

.class public final Lokhttp3/Headers$Builder;
.super Ljava/lang/Object;
.source "Headers.java"
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lokhttp3/Headers;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x19
name = "Builder"
.end annotation
# instance fields
.field private final namesAndValues:Ljava/util/List;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/List",
"<",
"Ljava/lang/String;",
">;"
}
.end annotation
.end field
# direct methods
.method public constructor <init>()V
.locals 2
.prologue
.line 202
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
.line 203
new-instance v0, Ljava/util/ArrayList;
const/16 v1, 0x14
invoke-direct {v0, v1}, Ljava/util/ArrayList;-><init>(I)V
iput-object v0, p0, Lokhttp3/Headers$Builder;->namesAndValues:Ljava/util/List;
return-void
.end method
.method static synthetic access$000(Lokhttp3/Headers$Builder;)Ljava/util/List;
.locals 1
.prologue
.line 202
iget-object v0, p0, Lokhttp3/Headers$Builder;->namesAndValues:Ljava/util/List;
return-object v0
.end method
.method private checkNameAndValue(Ljava/lang/String;Ljava/lang/String;)V
.locals 9
.prologue
const/16 v5, 0x1f
const/4 v8, 0x3
const/4 v7, 0x2
const/4 v6, 0x1
const/4 v1, 0x0
.line 270
if-nez p1, :cond_0
new-instance v0, Ljava/lang/IllegalArgumentException;
const-string v1, "name == null"
invoke-direct {v0, v1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw v0
.line 271
:cond_0
invoke-virtual {p1}, Ljava/lang/String;->isEmpty()Z
move-result v0
if-eqz v0, :cond_1
new-instance v0, Ljava/lang/IllegalArgumentException;
const-string v1, "name is empty"
invoke-direct {v0, v1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw v0
.line 272
:cond_1
invoke-virtual {p1}, Ljava/lang/String;->length()I
move-result v2
move v0, v1
:goto_0
if-ge v0, v2, :cond_4
.line 273
invoke-virtual {p1, v0}, Ljava/lang/String;->charAt(I)C
move-result v3
.line 274
if-le v3, v5, :cond_2
const/16 v4, 0x7f
if-lt v3, v4, :cond_3
.line 275
:cond_2
new-instance v2, Ljava/lang/IllegalArgumentException;
const-string v4, "Unexpected char %#04x at %d in header name: %s"
new-array v5, v8, [Ljava/lang/Object;
.line 276
invoke-static {v3}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v3
aput-object v3, v5, v1
invoke-static {v0}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v0
aput-object v0, v5, v6
aput-object p1, v5, v7
.line 275
invoke-static {v4, v5}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
move-result-object v0
invoke-direct {v2, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw v2
.line 272
:cond_3
add-int/lit8 v0, v0, 0x1
goto :goto_0
.line 279
:cond_4
if-nez p2, :cond_5
new-instance v0, Ljava/lang/IllegalArgumentException;
const-string v1, "value == null"
invoke-direct {v0, v1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw v0
.line 280
:cond_5
invoke-virtual {p2}, Ljava/lang/String;->length()I
move-result v2
move v0, v1
:goto_1
if-ge v0, v2, :cond_8
.line 281
invoke-virtual {p2, v0}, Ljava/lang/String;->charAt(I)C
move-result v3
.line 282
if-le v3, v5, :cond_6
const/16 v4, 0x7f
if-lt v3, v4, :cond_7
.line 283
:cond_6
new-instance v2, Ljava/lang/IllegalArgumentException;
const-string v4, "Unexpected char %#04x at %d in %s value: %s"
const/4 v5, 0x4
new-array v5, v5, [Ljava/lang/Object;
.line 284
invoke-static {v3}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v3
aput-object v3, v5, v1
invoke-static {v0}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v0
aput-object v0, v5, v6
aput-object p1, v5, v7
aput-object p2, v5, v8
.line 283
invoke-static {v4, v5}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
move-result-object v0
invoke-direct {v2, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw v2
.line 280
:cond_7
add-int/lit8 v0, v0, 0x1
goto :goto_1
.line 287
:cond_8
return-void
.end method
# virtual methods
.method public add(Ljava/lang/String;)Lokhttp3/Headers$Builder;
.locals 3
.prologue
.line 224
const-string v0, ":"
invoke-virtual {p1, v0}, Ljava/lang/String;->indexOf(Ljava/lang/String;)I
move-result v0
.line 225
const/4 v1, -0x1
if-ne v0, v1, :cond_0
.line 226
new-instance v0, Ljava/lang/IllegalArgumentException;
new-instance v1, Ljava/lang/StringBuilder;
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
const-string v2, "Unexpected header: "
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v1
invoke-direct {v0, v1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw v0
.line 228
:cond_0
const/4 v1, 0x0
invoke-virtual {p1, v1, v0}, Ljava/lang/String;->substring(II)Ljava/lang/String;
move-result-object v1
invoke-virtual {v1}, Ljava/lang/String;->trim()Ljava/lang/String;
move-result-object v1
add-int/lit8 v0, v0, 0x1
invoke-virtual {p1, v0}, Ljava/lang/String;->substring(I)Ljava/lang/String;
move-result-object v0
invoke-virtual {p0, v1, v0}, Lokhttp3/Headers$Builder;->add(Ljava/lang/String;Ljava/lang/String;)Lokhttp3/Headers$Builder;
move-result-object v0
return-object v0
.end method
.method public add(Ljava/lang/String;Ljava/lang/String;)Lokhttp3/Headers$Builder;
.locals 1
.prologue
.line 233
invoke-direct {p0, p1, p2}, Lokhttp3/Headers$Builder;->checkNameAndValue(Ljava/lang/String;Ljava/lang/String;)V
.line 234
invoke-virtual {p0, p1, p2}, Lokhttp3/Headers$Builder;->addLenient(Ljava/lang/String;Ljava/lang/String;)Lokhttp3/Headers$Builder;
move-result-object v0
return-object v0
.end method
.method addLenient(Ljava/lang/String;)Lokhttp3/Headers$Builder;
.locals 3
.prologue
const/4 v2, 0x1
.line 210
const-string v0, ":"
invoke-virtual {p1, v0, v2}, Ljava/lang/String;->indexOf(Ljava/lang/String;I)I
move-result v0
.line 211
const/4 v1, -0x1
if-eq v0, v1, :cond_0
.line 212
const/4 v1, 0x0
invoke-virtual {p1, v1, v0}, Ljava/lang/String;->substring(II)Ljava/lang/String;
move-result-object v1
add-int/lit8 v0, v0, 0x1
invoke-virtual {p1, v0}, Ljava/lang/String;->substring(I)Ljava/lang/String;
move-result-object v0
invoke-virtual {p0, v1, v0}, Lokhttp3/Headers$Builder;->addLenient(Ljava/lang/String;Ljava/lang/String;)Lokhttp3/Headers$Builder;
move-result-object v0
.line 218
:goto_0
return-object v0
.line 213
:cond_0
const-string v0, ":"
invoke-virtual {p1, v0}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z
move-result v0
if-eqz v0, :cond_1
.line 216
const-string v0, ""
invoke-virtual {p1, v2}, Ljava/lang/String;->substring(I)Ljava/lang/String;
move-result-object v1
invoke-virtual {p0, v0, v1}, Lokhttp3/Headers$Builder;->addLenient(Ljava/lang/String;Ljava/lang/String;)Lokhttp3/Headers$Builder;
move-result-object v0
goto :goto_0
.line 218
:cond_1
const-string v0, ""
invoke-virtual {p0, v0, p1}, Lokhttp3/Headers$Builder;->addLenient(Ljava/lang/String;Ljava/lang/String;)Lokhttp3/Headers$Builder;
move-result-object v0
goto :goto_0
.end method
.method addLenient(Ljava/lang/String;Ljava/lang/String;)Lokhttp3/Headers$Builder;
.locals 2
.prologue
.line 242
iget-object v0, p0, Lokhttp3/Headers$Builder;->namesAndValues:Ljava/util/List;
invoke-interface {v0, p1}, Ljava/util/List;->add(Ljava/lang/Object;)Z
.line 243
iget-object v0, p0, Lokhttp3/Headers$Builder;->namesAndValues:Ljava/util/List;
invoke-virtual {p2}, Ljava/lang/String;->trim()Ljava/lang/String;
move-result-object v1
invoke-interface {v0, v1}, Ljava/util/List;->add(Ljava/lang/Object;)Z
.line 244
return-object p0
.end method
.method public build()Lokhttp3/Headers;
.locals 2
.prologue
.line 300
new-instance v0, Lokhttp3/Headers;
const/4 v1, 0x0
invoke-direct {v0, p0, v1}, Lokhttp3/Headers;-><init>(Lokhttp3/Headers$Builder;Lokhttp3/Headers$1;)V
return-object v0
.end method
.method public get(Ljava/lang/String;)Ljava/lang/String;
.locals 2
.prologue
.line 291
iget-object v0, p0, Lokhttp3/Headers$Builder;->namesAndValues:Ljava/util/List;
invoke-interface {v0}, Ljava/util/List;->size()I
move-result v0
add-int/lit8 v0, v0, -0x2
move v1, v0
:goto_0
if-ltz v1, :cond_1
.line 292
iget-object v0, p0, Lokhttp3/Headers$Builder;->namesAndValues:Ljava/util/List;
invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v0
check-cast v0, Ljava/lang/String;
invoke-virtual {p1, v0}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z
move-result v0
if-eqz v0, :cond_0
.line 293
iget-object v0, p0, Lokhttp3/Headers$Builder;->namesAndValues:Ljava/util/List;
add-int/lit8 v1, v1, 0x1
invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v0
check-cast v0, Ljava/lang/String;
.line 296
:goto_1
return-object v0
.line 291
:cond_0
add-int/lit8 v0, v1, -0x2
move v1, v0
goto :goto_0
.line 296
:cond_1
const/4 v0, 0x0
goto :goto_1
.end method
.method public removeAll(Ljava/lang/String;)Lokhttp3/Headers$Builder;
.locals 2
.prologue
.line 248
const/4 v0, 0x0
move v1, v0
:goto_0
iget-object v0, p0, Lokhttp3/Headers$Builder;->namesAndValues:Ljava/util/List;
invoke-interface {v0}, Ljava/util/List;->size()I
move-result v0
if-ge v1, v0, :cond_1
.line 249
iget-object v0, p0, Lokhttp3/Headers$Builder;->namesAndValues:Ljava/util/List;
invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v0
check-cast v0, Ljava/lang/String;
invoke-virtual {p1, v0}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z
move-result v0
if-eqz v0, :cond_0
.line 250
iget-object v0, p0, Lokhttp3/Headers$Builder;->namesAndValues:Ljava/util/List;
invoke-interface {v0, v1}, Ljava/util/List;->remove(I)Ljava/lang/Object;
.line 251
iget-object v0, p0, Lokhttp3/Headers$Builder;->namesAndValues:Ljava/util/List;
invoke-interface {v0, v1}, Ljava/util/List;->remove(I)Ljava/lang/Object;
.line 252
add-int/lit8 v1, v1, -0x2
.line 248
:cond_0
add-int/lit8 v0, v1, 0x2
move v1, v0
goto :goto_0
.line 255
:cond_1
return-object p0
.end method
.method public set(Ljava/lang/String;Ljava/lang/String;)Lokhttp3/Headers$Builder;
.locals 0
.prologue
.line 263
invoke-direct {p0, p1, p2}, Lokhttp3/Headers$Builder;->checkNameAndValue(Ljava/lang/String;Ljava/lang/String;)V
.line 264
invoke-virtual {p0, p1}, Lokhttp3/Headers$Builder;->removeAll(Ljava/lang/String;)Lokhttp3/Headers$Builder;
.line 265
invoke-virtual {p0, p1, p2}, Lokhttp3/Headers$Builder;->addLenient(Ljava/lang/String;Ljava/lang/String;)Lokhttp3/Headers$Builder;
.line 266
return-object p0
.end method