Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 10 for fromJson (0.69 sec)

  1. okhttp-hpacktests/src/test/java/okhttp3/internal/http2/hpackjson/HpackJsonUtil.kt

              @FromJson fun byteStringFromJson(json: String) = json.decodeHex()
            },
          ).add(KotlinJsonAdapterFactory())
          .build()
      private val STORY_JSON_ADAPTER = MOSHI.adapter(Story::class.java)
    
      private val fileSystem = FileSystem.SYSTEM
    
      private fun readStory(source: BufferedSource): Story = STORY_JSON_ADAPTER.fromJson(source)!!
    
      private fun readStory(file: Path): Story {
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Wed Mar 19 19:25:20 UTC 2025
    - 3.3K bytes
    - Viewed (0)
  2. samples/guide/src/main/java/okhttp3/recipes/kt/ParseResponseWithMoshi.kt

            .build()
        client.newCall(request).execute().use { response ->
          if (!response.isSuccessful) throw IOException("Unexpected code $response")
    
          val gist = gistJsonAdapter.fromJson(response.body!!.source())
    
          for ((key, value) in gist!!.files!!) {
            println(key)
            println(value.content)
          }
        }
      }
    
      @JsonClass(generateAdapter = true)
      data class Gist(
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Wed Mar 19 19:25:20 UTC 2025
    - 1.6K bytes
    - Viewed (0)
  3. .teamcity/src/main/kotlin/model/FunctionalTestBucketModel.kt

            parallelizationMethod,
        )
    
        constructor(jsonObject: Map<String, Any>) : this(
            (jsonObject["subprojects"] as List<*>).map { it.toString() },
            ParallelizationMethod.fromJson(jsonObject),
        )
    
        fun toBuildTypeBucket(gradleSubprojectProvider: GradleSubprojectProvider): SmallSubprojectBucket =
            SmallSubprojectBucket(
    Registered: Wed Sep 10 11:36:15 UTC 2025
    - Last Modified: Thu Apr 10 15:09:32 UTC 2025
    - 3.4K bytes
    - Viewed (0)
  4. .github/workflows/build-docs.yml

      build-docs:
        needs:
          - changes
          - langs
        if: ${{ needs.changes.outputs.docs == 'true' }}
        runs-on: ubuntu-latest
        strategy:
          matrix:
            lang: ${{ fromJson(needs.langs.outputs.langs) }}
        steps:
          - name: Dump GitHub context
            env:
              GITHUB_CONTEXT: ${{ toJson(github) }}
            run: echo "$GITHUB_CONTEXT"
          - uses: actions/checkout@v5
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Fri Aug 15 21:44:06 UTC 2025
    - 4.1K bytes
    - Viewed (0)
  5. samples/simple-client/src/main/java/okhttp3/sample/OkHttpContributors.java

        try (Response response = client.newCall(request).execute()) {
          // Deserialize HTTP response to concrete type.
          ResponseBody body = response.body();
          List<Contributor> contributors = CONTRIBUTORS_JSON_ADAPTER.fromJson(body.source());
    
          // Sort list by the most contributions.
          Collections.sort(contributors, (c1, c2) -> c2.contributions - c1.contributions);
    
          // Output list of contributors.
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Fri Apr 05 03:30:42 UTC 2024
    - 2.2K bytes
    - Viewed (0)
  6. .github/workflows/contributor-pr.yml

      unit-test:
        name: "${{ matrix.bucket.name }} (Unit Test)"
        permissions:
          contents: read
        runs-on: ubuntu-latest
        needs: build
        strategy:
          matrix:
            bucket: ${{ fromJson(needs.build.outputs.matrix) }}
          fail-fast: false
        steps:
          - name: git clone
            uses: actions/checkout@v5
          - name: setup java
            uses: actions/setup-java@v5
            with:
    Registered: Wed Sep 10 11:36:15 UTC 2025
    - Last Modified: Thu Sep 04 22:13:34 UTC 2025
    - 4.1K bytes
    - Viewed (0)
  7. .teamcity/src/main/kotlin/configurations/FunctionalTest.kt

        }
    
        class TeamCityParallelTests(
            val numberOfBatches: Int,
        ) : ParallelizationMethod()
    
        companion object {
            private val objectMapper = ObjectMapper()
    
            fun fromJson(jsonObject: Map<String, Any>): ParallelizationMethod {
                val methodJsonNode =
                    (jsonObject["parallelizationMethod"] as? Map<*, *>)?.let { objectMapper.valueToTree<JsonNode>(it) }
    Registered: Wed Sep 10 11:36:15 UTC 2025
    - Last Modified: Wed Feb 12 09:12:03 UTC 2025
    - 5.6K bytes
    - Viewed (0)
  8. .teamcity/src/main/kotlin/model/FunctionalTestBucketGenerator.kt

            model: CIBuildModel,
        ): Map<TestCoverage, List<SmallSubprojectBucket>> {
            val sType = object : TypeToken<BuildProjectToSubprojectTestClassTimes>() {}.type
            val buildProjectClassTimes = gson.fromJson<BuildProjectToSubprojectTestClassTimes>(buildClassTimeJson.readText(), sType)
    
            val result = mutableMapOf<TestCoverage, List<SmallSubprojectBucket>>()
            for (stage in model.stages) {
    Registered: Wed Sep 10 11:36:15 UTC 2025
    - Last Modified: Thu Apr 10 15:09:32 UTC 2025
    - 7.3K bytes
    - Viewed (0)
  9. docs/recipes.md

                .build()
            client.newCall(request).execute().use { response ->
              if (!response.isSuccessful) throw IOException("Unexpected code $response")
    
              val gist = gistJsonAdapter.fromJson(response.body!!.source())
    
              for ((key, value) in gist!!.files!!) {
                println(key)
                println(value.content)
              }
            }
          }
    
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Sat Aug 30 17:01:12 UTC 2025
    - 47.8K bytes
    - Viewed (0)
  10. android-test/src/androidTest/java/okhttp/android/test/OkHttpTest.kt

        val response = client.newCall(request).execute()
    
        val results =
          response.use {
            moshi.adapter(HowsMySslResults::class.java).fromJson(response.body.string())!!
          }
    
        Platform.get().log("results $results", Platform.WARN)
    
        assertTrue(results.session_ticket_supported)
        assertEquals("Probably Okay", results.rating)
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Sat Aug 02 14:12:28 UTC 2025
    - 29K bytes
    - Viewed (0)
Back to top