.class public final Lokhttp3/Headers$Companion; .super Ljava/lang/Object; .source "Headers.kt" # annotations .annotation system Ldalvik/annotation/EnclosingClass; value = Lokhttp3/Headers; .end annotation .annotation system Ldalvik/annotation/InnerClass; accessFlags = 0x19 name = "Companion" .end annotation .annotation system Ldalvik/annotation/SourceDebugExtension; value = "SMAP\nHeaders.kt\nKotlin\n*S Kotlin\n*F\n+ 1 Headers.kt\nokhttp3/Headers$Companion\n+ 2 fake.kt\nkotlin/jvm/internal/FakeKt\n*L\n1#1,441:1\n1#2:442\n*E\n" .end annotation .annotation runtime Lkotlin/Metadata; bv = { 0x1, 0x0, 0x3 } d1 = { "\u00002\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\u0008\u0002\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\u000e\n\u0002\u0008\u0004\n\u0002\u0010\u0011\n\u0002\u0008\u0002\n\u0002\u0018\u0002\n\u0002\u0008\u0004\n\u0002\u0010$\n\u0002\u0008\u0002\u0008\u0086\u0003\u0018\u00002\u00020\u0001B\u0007\u0008\u0002\u00a2\u0006\u0002\u0010\u0002J\u0010\u0010\u0003\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u0006H\u0002J\u0018\u0010\u0007\u001a\u00020\u00042\u0006\u0010\u0008\u001a\u00020\u00062\u0006\u0010\u0005\u001a\u00020\u0006H\u0002J%\u0010\t\u001a\u0004\u0018\u00010\u00062\u000c\u0010\n\u001a\u0008\u0012\u0004\u0012\u00020\u00060\u000b2\u0006\u0010\u0005\u001a\u00020\u0006H\u0002\u00a2\u0006\u0002\u0010\u000cJ#\u0010\r\u001a\u00020\u000e2\u0012\u0010\n\u001a\n\u0012\u0006\u0008\u0001\u0012\u00020\u00060\u000b\"\u00020\u0006H\u0007\u00a2\u0006\u0004\u0008\u000f\u0010\u0010J#\u0010\u000f\u001a\u00020\u000e2\u0012\u0010\n\u001a\n\u0012\u0006\u0008\u0001\u0012\u00020\u00060\u000b\"\u00020\u0006H\u0007\u00a2\u0006\u0004\u0008\u0011\u0010\u0010J!\u0010\u000f\u001a\u00020\u000e2\u0012\u0010\u0012\u001a\u000e\u0012\u0004\u0012\u00020\u0006\u0012\u0004\u0012\u00020\u00060\u0013H\u0007\u00a2\u0006\u0002\u0008\u0011J\u001d\u0010\u0014\u001a\u00020\u000e*\u000e\u0012\u0004\u0012\u00020\u0006\u0012\u0004\u0012\u00020\u00060\u0013H\u0007\u00a2\u0006\u0002\u0008\u000f\u00a8\u0006\u0015" } d2 = { "Lokhttp3/Headers$Companion;", "", "()V", "checkName", "", "name", "", "checkValue", "value", "get", "namesAndValues", "", "([Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;", "headersOf", "Lokhttp3/Headers;", "of", "([Ljava/lang/String;)Lokhttp3/Headers;", "-deprecated_of", "headers", "", "toHeaders", "okhttp" } k = 0x1 mv = { 0x1, 0x4, 0x0 } .end annotation # direct methods .method private constructor ()V .locals 0 .line 346 invoke-direct {p0}, Ljava/lang/Object;->()V return-void .end method .method public synthetic constructor (Lkotlin/jvm/internal/DefaultConstructorMarker;)V .locals 0 .line 346 invoke-direct {p0}, Lokhttp3/Headers$Companion;->()V return-void .end method .method public static final synthetic access$checkName(Lokhttp3/Headers$Companion;Ljava/lang/String;)V .locals 0 .line 346 invoke-direct {p0, p1}, Lokhttp3/Headers$Companion;->checkName(Ljava/lang/String;)V return-void .end method .method public static final synthetic access$checkValue(Lokhttp3/Headers$Companion;Ljava/lang/String;Ljava/lang/String;)V .locals 0 .line 346 invoke-direct {p0, p1, p2}, Lokhttp3/Headers$Companion;->checkValue(Ljava/lang/String;Ljava/lang/String;)V return-void .end method .method public static final synthetic access$get(Lokhttp3/Headers$Companion;[Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; .locals 0 .line 346 invoke-direct {p0, p1, p2}, Lokhttp3/Headers$Companion;->get([Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; move-result-object p0 return-object p0 .end method .method private final checkName(Ljava/lang/String;)V .locals 5 .line 422 move-object p0, p1 check-cast p0, Ljava/lang/CharSequence; invoke-interface {p0}, Ljava/lang/CharSequence;->length()I move-result p0 const/4 v0, 0x1 const/4 v1, 0x0 if-lez p0, :cond_0 move p0, v0 goto :goto_0 :cond_0 move p0, v1 :goto_0 if-eqz p0, :cond_5 .line 423 invoke-virtual {p1}, Ljava/lang/String;->length()I move-result p0 move v2, v1 :goto_1 if-ge v2, p0, :cond_4 .line 424 invoke-virtual {p1, v2}, Ljava/lang/String;->charAt(I)C move-result v3 const/16 v4, 0x21 if-le v4, v3, :cond_1 goto :goto_2 :cond_1 const/16 v4, 0x7e if-lt v4, v3, :cond_2 move v4, v0 goto :goto_3 :cond_2 :goto_2 move v4, v1 :goto_3 if-eqz v4, :cond_3 add-int/lit8 v2, v2, 0x1 goto :goto_1 .line 426 :cond_3 invoke-static {v3}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer; move-result-object p0 invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer; move-result-object v0 filled-new-array {p0, v0, p1}, [Ljava/lang/Object; move-result-object p0 const-string p1, "Unexpected char %#04x at %d in header name: %s" invoke-static {p1, p0}, Lokhttp3/internal/Util;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String; move-result-object p0 .line 425 new-instance p1, Ljava/lang/IllegalArgumentException; invoke-virtual {p0}, Ljava/lang/Object;->toString()Ljava/lang/String; move-result-object p0 invoke-direct {p1, p0}, Ljava/lang/IllegalArgumentException;->(Ljava/lang/String;)V check-cast p1, Ljava/lang/Throwable; throw p1 :cond_4 return-void .line 422 :cond_5 new-instance p0, Ljava/lang/IllegalArgumentException; const-string p1, "name is empty" invoke-virtual {p1}, Ljava/lang/Object;->toString()Ljava/lang/String; move-result-object p1 invoke-direct {p0, p1}, Ljava/lang/IllegalArgumentException;->(Ljava/lang/String;)V check-cast p0, Ljava/lang/Throwable; throw p0 .end method .method private final checkValue(Ljava/lang/String;Ljava/lang/String;)V .locals 4 .line 432 invoke-virtual {p1}, Ljava/lang/String;->length()I move-result p0 const/4 v0, 0x0 move v1, v0 :goto_0 if-ge v1, p0, :cond_4 .line 433 invoke-virtual {p1, v1}, Ljava/lang/String;->charAt(I)C move-result v2 const/16 v3, 0x9 if-eq v2, v3, :cond_2 const/16 v3, 0x20 if-le v3, v2, :cond_0 goto :goto_1 :cond_0 const/16 v3, 0x7e if-lt v3, v2, :cond_1 goto :goto_2 :cond_1 :goto_1 move v3, v0 goto :goto_3 :cond_2 :goto_2 const/4 v3, 0x1 :goto_3 if-eqz v3, :cond_3 add-int/lit8 v1, v1, 0x1 goto :goto_0 .line 435 :cond_3 invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer; move-result-object p0 invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer; move-result-object v0 filled-new-array {p0, v0, p2, p1}, [Ljava/lang/Object; move-result-object p0 const-string p1, "Unexpected char %#04x at %d in %s value: %s" invoke-static {p1, p0}, Lokhttp3/internal/Util;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String; move-result-object p0 .line 434 new-instance p1, Ljava/lang/IllegalArgumentException; invoke-virtual {p0}, Ljava/lang/Object;->toString()Ljava/lang/String; move-result-object p0 invoke-direct {p1, p0}, Ljava/lang/IllegalArgumentException;->(Ljava/lang/String;)V check-cast p1, Ljava/lang/Throwable; throw p1 :cond_4 return-void .end method .method private final get([Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; .locals 4 .line 348 array-length p0, p1 const/4 v0, 0x2 sub-int/2addr p0, v0 const/4 v1, 0x0 invoke-static {p0, v1}, Lkotlin/ranges/RangesKt;->downTo(II)Lkotlin/ranges/IntProgression; move-result-object p0 invoke-static {p0, v0}, Lkotlin/ranges/RangesKt;->step(Lkotlin/ranges/IntProgression;I)Lkotlin/ranges/IntProgression; move-result-object p0 invoke-virtual {p0}, Lkotlin/ranges/IntProgression;->getFirst()I move-result v0 invoke-virtual {p0}, Lkotlin/ranges/IntProgression;->getLast()I move-result v1 invoke-virtual {p0}, Lkotlin/ranges/IntProgression;->getStep()I move-result p0 if-ltz p0, :cond_0 if-gt v0, v1, :cond_2 goto :goto_0 :cond_0 if-lt v0, v1, :cond_2 .line 349 :goto_0 aget-object v2, p1, v0 const/4 v3, 0x1 invoke-static {p2, v2, v3}, Lkotlin/text/StringsKt;->equals(Ljava/lang/String;Ljava/lang/String;Z)Z move-result v2 if-eqz v2, :cond_1 add-int/2addr v0, v3 .line 350 aget-object p0, p1, v0 return-object p0 :cond_1 if-eq v0, v1, :cond_2 add-int/2addr v0, p0 goto :goto_0 :cond_2 const/4 p0, 0x0 return-object p0 .end method # virtual methods .method public final -deprecated_of(Ljava/util/Map;)Lokhttp3/Headers; .locals 1 .annotation system Ldalvik/annotation/Signature; value = { "(", "Ljava/util/Map<", "Ljava/lang/String;", "Ljava/lang/String;", ">;)", "Lokhttp3/Headers;" } .end annotation .annotation runtime Lkotlin/Deprecated; level = .enum Lkotlin/DeprecationLevel;->ERROR:Lkotlin/DeprecationLevel; message = "function moved to extension" replaceWith = .subannotation Lkotlin/ReplaceWith; expression = "headers.toHeaders()" imports = {} .end subannotation .end annotation const-string v0, "headers" invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V .line 418 move-object v0, p0 check-cast v0, Lokhttp3/Headers$Companion; invoke-virtual {p0, p1}, Lokhttp3/Headers$Companion;->of(Ljava/util/Map;)Lokhttp3/Headers; move-result-object p0 return-object p0 .end method .method public final varargs -deprecated_of([Ljava/lang/String;)Lokhttp3/Headers; .locals 1 .annotation runtime Lkotlin/Deprecated; level = .enum Lkotlin/DeprecationLevel;->ERROR:Lkotlin/DeprecationLevel; message = "function name changed" replaceWith = .subannotation Lkotlin/ReplaceWith; expression = "headersOf(*namesAndValues)" imports = {} .end subannotation .end annotation const-string v0, "namesAndValues" invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V .line 389 move-object v0, p0 check-cast v0, Lokhttp3/Headers$Companion; array-length v0, p1 invoke-static {p1, v0}, Ljava/util/Arrays;->copyOf([Ljava/lang/Object;I)[Ljava/lang/Object; move-result-object p1 check-cast p1, [Ljava/lang/String; invoke-virtual {p0, p1}, Lokhttp3/Headers$Companion;->of([Ljava/lang/String;)Lokhttp3/Headers; move-result-object p0 return-object p0 .end method .method public final of(Ljava/util/Map;)Lokhttp3/Headers; .locals 5 .annotation system Ldalvik/annotation/Signature; value = { "(", "Ljava/util/Map<", "Ljava/lang/String;", "Ljava/lang/String;", ">;)", "Lokhttp3/Headers;" } .end annotation .annotation runtime Lkotlin/jvm/JvmStatic; .end annotation const-string v0, "$this$toHeaders" invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V .line 397 invoke-interface {p1}, Ljava/util/Map;->size()I move-result v0 mul-int/lit8 v0, v0, 0x2 new-array v0, v0, [Ljava/lang/String; .line 399 invoke-interface {p1}, Ljava/util/Map;->entrySet()Ljava/util/Set; move-result-object p1 invoke-interface {p1}, Ljava/util/Set;->iterator()Ljava/util/Iterator; move-result-object p1 const/4 v1, 0x0 :goto_0 invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z move-result v2 if-eqz v2, :cond_2 invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object; move-result-object v2 check-cast v2, Ljava/util/Map$Entry; invoke-interface {v2}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object; move-result-object v3 check-cast v3, Ljava/lang/String; invoke-interface {v2}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object; move-result-object v2 check-cast v2, Ljava/lang/String; const-string v4, "null cannot be cast to non-null type kotlin.CharSequence" if-eqz v3, :cond_1 .line 400 check-cast v3, Ljava/lang/CharSequence; invoke-static {v3}, Lkotlin/text/StringsKt;->trim(Ljava/lang/CharSequence;)Ljava/lang/CharSequence; move-result-object v3 invoke-virtual {v3}, Ljava/lang/Object;->toString()Ljava/lang/String; move-result-object v3 if-eqz v2, :cond_0 .line 401 check-cast v2, Ljava/lang/CharSequence; invoke-static {v2}, Lkotlin/text/StringsKt;->trim(Ljava/lang/CharSequence;)Ljava/lang/CharSequence; move-result-object v2 invoke-virtual {v2}, Ljava/lang/Object;->toString()Ljava/lang/String; move-result-object v2 .line 402 move-object v4, p0 check-cast v4, Lokhttp3/Headers$Companion; invoke-direct {p0, v3}, Lokhttp3/Headers$Companion;->checkName(Ljava/lang/String;)V .line 403 invoke-direct {p0, v2, v3}, Lokhttp3/Headers$Companion;->checkValue(Ljava/lang/String;Ljava/lang/String;)V .line 404 aput-object v3, v0, v1 add-int/lit8 v3, v1, 0x1 .line 405 aput-object v2, v0, v3 add-int/lit8 v1, v1, 0x2 goto :goto_0 .line 401 :cond_0 new-instance p0, Ljava/lang/NullPointerException; invoke-direct {p0, v4}, Ljava/lang/NullPointerException;->(Ljava/lang/String;)V throw p0 .line 400 :cond_1 new-instance p0, Ljava/lang/NullPointerException; invoke-direct {p0, v4}, Ljava/lang/NullPointerException;->(Ljava/lang/String;)V throw p0 .line 409 :cond_2 new-instance p0, Lokhttp3/Headers; const/4 p1, 0x0 invoke-direct {p0, v0, p1}, Lokhttp3/Headers;->([Ljava/lang/String;Lkotlin/jvm/internal/DefaultConstructorMarker;)V return-object p0 .end method .method public final varargs of([Ljava/lang/String;)Lokhttp3/Headers; .locals 7 .annotation runtime Lkotlin/jvm/JvmStatic; .end annotation const-string v0, "namesAndValues" invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V .line 363 array-length v0, p1 const/4 v1, 0x2 rem-int/2addr v0, v1 const/4 v2, 0x1 const/4 v3, 0x0 if-nez v0, :cond_0 move v0, v2 goto :goto_0 :cond_0 move v0, v3 :goto_0 if-eqz v0, :cond_8 .line 366 invoke-virtual {p1}, Ljava/lang/Object;->clone()Ljava/lang/Object; move-result-object p1 if-eqz p1, :cond_7 check-cast p1, [Ljava/lang/String; .line 367 array-length v0, p1 move v4, v3 :goto_1 if-ge v4, v0, :cond_4 .line 368 aget-object v5, p1, v4 if-eqz v5, :cond_1 move v6, v2 goto :goto_2 :cond_1 move v6, v3 :goto_2 if-eqz v6, :cond_3 if-eqz v5, :cond_2 .line 369 check-cast v5, Ljava/lang/CharSequence; invoke-static {v5}, Lkotlin/text/StringsKt;->trim(Ljava/lang/CharSequence;)Ljava/lang/CharSequence; move-result-object v5 invoke-virtual {v5}, Ljava/lang/Object;->toString()Ljava/lang/String; move-result-object v5 aput-object v5, p1, v4 add-int/lit8 v4, v4, 0x1 goto :goto_1 :cond_2 new-instance p0, Ljava/lang/NullPointerException; const-string p1, "null cannot be cast to non-null type kotlin.CharSequence" invoke-direct {p0, p1}, Ljava/lang/NullPointerException;->(Ljava/lang/String;)V throw p0 .line 368 :cond_3 new-instance p0, Ljava/lang/IllegalArgumentException; const-string p1, "Headers cannot be null" invoke-virtual {p1}, Ljava/lang/Object;->toString()Ljava/lang/String; move-result-object p1 invoke-direct {p0, p1}, Ljava/lang/IllegalArgumentException;->(Ljava/lang/String;)V check-cast p0, Ljava/lang/Throwable; throw p0 .line 373 :cond_4 array-length v0, p1 invoke-static {v3, v0}, Lkotlin/ranges/RangesKt;->until(II)Lkotlin/ranges/IntRange; move-result-object v0 check-cast v0, Lkotlin/ranges/IntProgression; invoke-static {v0, v1}, Lkotlin/ranges/RangesKt;->step(Lkotlin/ranges/IntProgression;I)Lkotlin/ranges/IntProgression; move-result-object v0 invoke-virtual {v0}, Lkotlin/ranges/IntProgression;->getFirst()I move-result v1 invoke-virtual {v0}, Lkotlin/ranges/IntProgression;->getLast()I move-result v2 invoke-virtual {v0}, Lkotlin/ranges/IntProgression;->getStep()I move-result v0 if-ltz v0, :cond_5 if-gt v1, v2, :cond_6 goto :goto_3 :cond_5 if-lt v1, v2, :cond_6 .line 374 :goto_3 aget-object v3, p1, v1 add-int/lit8 v4, v1, 0x1 .line 375 aget-object v4, p1, v4 .line 376 move-object v5, p0 check-cast v5, Lokhttp3/Headers$Companion; invoke-direct {p0, v3}, Lokhttp3/Headers$Companion;->checkName(Ljava/lang/String;)V .line 377 invoke-direct {p0, v4, v3}, Lokhttp3/Headers$Companion;->checkValue(Ljava/lang/String;Ljava/lang/String;)V if-eq v1, v2, :cond_6 add-int/2addr v1, v0 goto :goto_3 .line 380 :cond_6 new-instance p0, Lokhttp3/Headers; const/4 v0, 0x0 invoke-direct {p0, p1, v0}, Lokhttp3/Headers;->([Ljava/lang/String;Lkotlin/jvm/internal/DefaultConstructorMarker;)V return-object p0 .line 366 :cond_7 new-instance p0, Ljava/lang/NullPointerException; const-string p1, "null cannot be cast to non-null type kotlin.Array" invoke-direct {p0, p1}, Ljava/lang/NullPointerException;->(Ljava/lang/String;)V throw p0 .line 363 :cond_8 new-instance p0, Ljava/lang/IllegalArgumentException; const-string p1, "Expected alternating header names and values" invoke-virtual {p1}, Ljava/lang/Object;->toString()Ljava/lang/String; move-result-object p1 invoke-direct {p0, p1}, Ljava/lang/IllegalArgumentException;->(Ljava/lang/String;)V check-cast p0, Ljava/lang/Throwable; throw p0 .end method