Home
last modified time | relevance | path

Searched refs:jsonObject (Results 1 – 25 of 52) sorted by relevance

123

/external/mobly-bundled-snippets/src/main/java/com/google/android/mobly/snippet/bundled/utils/
DJsonDeserializer.java43 public static WifiConfiguration jsonToWifiConfig(JSONObject jsonObject) throws JSONException { in jsonToWifiConfig() argument
45 config.SSID = "\"" + jsonObject.getString("SSID") + "\""; in jsonToWifiConfig()
46 config.hiddenSSID = jsonObject.optBoolean("hiddenSSID", false); in jsonToWifiConfig()
47 if (jsonObject.has("password")) { in jsonToWifiConfig()
49 config.preSharedKey = "\"" + jsonObject.getString("password") + "\""; in jsonToWifiConfig()
57 public static AdvertiseSettings jsonToBleAdvertiseSettings(JSONObject jsonObject) in jsonToBleAdvertiseSettings() argument
60 if (jsonObject.has("AdvertiseMode")) { in jsonToBleAdvertiseSettings()
61 int mode = MbsEnums.BLE_ADVERTISE_MODE.getInt(jsonObject.getString("AdvertiseMode")); in jsonToBleAdvertiseSettings()
65 if (jsonObject.has("Timeout")) { in jsonToBleAdvertiseSettings()
66 builder.setTimeout(jsonObject.getInt("Timeout")); in jsonToBleAdvertiseSettings()
[all …]
/external/exoplayer/tree_8e57d3715f9092d5ec54ebe2e538f34bfcc34479/library/transformer/src/androidTest/java/com/google/android/exoplayer2/transformer/
DTransformationTestResult.java126 JSONObject jsonObject = new JSONObject(); in asJsonObject() local
128 jsonObject.put("durationMs", transformationResult.durationMs); in asJsonObject()
131 jsonObject.put("fileSizeBytes", transformationResult.fileSizeBytes); in asJsonObject()
134 jsonObject.put("averageAudioBitrate", transformationResult.averageAudioBitrate); in asJsonObject()
137 jsonObject.put("averageVideoBitrate", transformationResult.averageVideoBitrate); in asJsonObject()
140 jsonObject.put("videoFrameCount", transformationResult.videoFrameCount); in asJsonObject()
143 jsonObject.put("throughputFps", throughputFps); in asJsonObject()
146 jsonObject.put("elapsedTimeMs", elapsedTimeMs); in asJsonObject()
149 jsonObject.put("ssim", ssim); in asJsonObject()
152 jsonObject.put("analysisException", AndroidTestUtil.exceptionAsJsonObject(analysisException)); in asJsonObject()
[all …]
/external/vogar/src/vogar/monitor/
DTargetMonitor.java67 JsonObject jsonObject = new JsonObject();
68 jsonObject.addProperty("outcome", outcomeName);
69 writer.print(marker + gson.toJson(jsonObject) + "\n");
77 JsonObject jsonObject = new JsonObject();
78 jsonObject.addProperty("result", result.name());
79 writer.print(marker + gson.toJson(jsonObject) + "\n");
87 JsonObject jsonObject = new JsonObject();
88 jsonObject.addProperty("completedNormally", completedNormally);
89 writer.print(marker + gson.toJson(jsonObject) + "\n");
DHostMonitor.java123 JsonObject jsonObject = (JsonObject) o; in followProcess() local
124 if (jsonObject.get("outcome") != null) { in followProcess()
125 currentOutcome = jsonObject.get("outcome").getAsString(); in followProcess()
128 } else if (jsonObject.get("result") != null) { in followProcess()
129 Result currentResult = Result.valueOf(jsonObject.get("result").getAsString()); in followProcess()
133 } else if (jsonObject.get("completedNormally") != null) { in followProcess()
134 completedNormally = jsonObject.get("completedNormally").getAsBoolean(); in followProcess()
/external/jetpack-camera-app/core/camera/src/main/java/com/google/jetpackcamera/core/camera/
DDebugCameraInfoUtil.kt60 val jsonObject = JSONObject() in <lambda>() constant
64 jsonObject.put( in <lambda>()
71 jsonObject.put( in <lambda>()
78 jsonObject.put( in <lambda>()
87 jsonObject.put( in <lambda>()
95 ?.let { jsonObject.put(CameraCharacteristics.CONTROL_ZOOM_RATIO_RANGE.name, it) } in <lambda>()
99 jsonObject.put( in <lambda>()
106 jsonObject.put( in <lambda>()
113 jsonObject.put( in <lambda>()
119 return jsonObject in <lambda>()
/external/gson/gson/src/test/java/com/google/gson/internal/bind/
DJsonTreeReaderTest.java48 JsonObject jsonObject = new JsonObject(); in testSkipValue_filledJsonObject() local
52 jsonObject.add("a", jsonArray); in testSkipValue_filledJsonObject()
53 jsonObject.addProperty("b", true); in testSkipValue_filledJsonObject()
54 jsonObject.addProperty("i", 1); in testSkipValue_filledJsonObject()
55 jsonObject.add("n", JsonNull.INSTANCE); in testSkipValue_filledJsonObject()
58 jsonObject.add("o", jsonObject2); in testSkipValue_filledJsonObject()
59 jsonObject.addProperty("s", "text"); in testSkipValue_filledJsonObject()
60 JsonTreeReader in = new JsonTreeReader(jsonObject); in testSkipValue_filledJsonObject()
68 JsonObject jsonObject = new JsonObject(); in testSkipValue_name() local
69 jsonObject.addProperty("a", "value"); in testSkipValue_name()
[all …]
/external/mobly-snippet-lib/third_party/sl4a/src/main/java/com/google/android/mobly/snippet/rpc/
DMethodDescriptor.java205 private static Object buildIntent(JSONObject jsonObject) throws JSONException { in buildIntent() argument
207 if (jsonObject.has("action")) { in buildIntent()
208 intent.setAction(jsonObject.getString("action")); in buildIntent()
210 if (jsonObject.has("data") && jsonObject.has("type")) { in buildIntent()
212 Uri.parse(jsonObject.optString("data", null)), in buildIntent()
213 jsonObject.optString("type", null)); in buildIntent()
214 } else if (jsonObject.has("data")) { in buildIntent()
215 intent.setData(Uri.parse(jsonObject.optString("data", null))); in buildIntent()
216 } else if (jsonObject.has("type")) { in buildIntent()
217 intent.setType(jsonObject.optString("type", null)); in buildIntent()
[all …]
/external/exoplayer/tree_15dc86382f17a24a3e881e52e31a810c1ea44b49/library/rtsp/src/test/java/com/google/android/exoplayer2/source/rtsp/
DRtpPacketStreamDump.java65 JSONObject jsonObject = new JSONObject(jsonString); in parse() local
66 String trackName = jsonObject.getString("trackName"); in parse()
67 int firstSequenceNumber = jsonObject.getInt("firstSequenceNumber"); in parse()
68 long firstTimestamp = jsonObject.getLong("firstTimestamp"); in parse()
69 long transmissionIntervalMs = jsonObject.getLong("transmitIntervalMs"); in parse()
70 String mediaDescription = jsonObject.getString("mediaDescription"); in parse()
73 JSONArray jsonPackets = jsonObject.getJSONArray("packets"); in parse()
/external/exoplayer/tree_8e57d3715f9092d5ec54ebe2e538f34bfcc34479/library/rtsp/src/test/java/com/google/android/exoplayer2/source/rtsp/
DRtpPacketStreamDump.java65 JSONObject jsonObject = new JSONObject(jsonString); in parse() local
66 String trackName = jsonObject.getString("trackName"); in parse()
67 int firstSequenceNumber = jsonObject.getInt("firstSequenceNumber"); in parse()
68 long firstTimestamp = jsonObject.getLong("firstTimestamp"); in parse()
69 long transmissionIntervalMs = jsonObject.getLong("transmitIntervalMs"); in parse()
70 String mediaDescription = jsonObject.getString("mediaDescription"); in parse()
73 JSONArray jsonPackets = jsonObject.getJSONArray("packets"); in parse()
/external/tink/java_src/src/test/java/com/google/crypto/tink/internal/
DJsonParserTest.java76 public static JsonObject jsonObject(String name, JsonElement value) { in jsonObject() method in JsonParserTest
94 new TestCase("map", "{\"a\":\"b\"}", jsonObject("a", new JsonPrimitive("b"))),
100 new TestCase("map_with_empty_key", "{\"\":\"a\"}", jsonObject("", new JsonPrimitive("a"))),
123 jsonObject(
125 jsonObject(
127 jsonObject(
129 jsonObject(
131 jsonObject(
133 jsonObject(
135 jsonObject(
[all …]
/external/tink-java/src/test/java/com/google/crypto/tink/internal/
DJsonParserTest.java76 public static JsonObject jsonObject(String name, JsonElement value) { in jsonObject() method in JsonParserTest
94 new TestCase("map", "{\"a\":\"b\"}", jsonObject("a", new JsonPrimitive("b"))),
100 new TestCase("map_with_empty_key", "{\"\":\"a\"}", jsonObject("", new JsonPrimitive("a"))),
123 jsonObject(
125 jsonObject(
127 jsonObject(
129 jsonObject(
131 jsonObject(
133 jsonObject(
135 jsonObject(
[all …]
/external/javaparser/javaparser-core-serialization/src/main/java/com/github/javaparser/serialization/
DJavaParserJsonDeserializer.java51 JsonObject jsonObject = reader.readObject(); in deserializeObject() local
52 return deserializeObject(jsonObject); in deserializeObject()
147 JsonObject jsonObject = (JsonObject)jsonValue; in readRange() local
149 jsonObject.getInt(JsonRange.BEGIN_LINE.propertyKey), in readRange()
150 jsonObject.getInt(JsonRange.BEGIN_COLUMN.propertyKey) in readRange()
153 jsonObject.getInt(JsonRange.END_LINE.propertyKey), in readRange()
154 jsonObject.getInt(JsonRange.END_COLUMN.propertyKey) in readRange()
164 JsonObject jsonObject = (JsonObject)jsonValue; in readTokenRange() local
166 JsonTokenRange.BEGIN_TOKEN.propertyKey, jsonObject in readTokenRange()
169 JsonTokenRange.END_TOKEN.propertyKey, jsonObject in readTokenRange()
[all …]
/external/kotlinx.serialization/guide/example/
Dexample-json-29.kt20 val jsonObject = element.jsonObject in transformDeserialize() constant
21 return if ("basic-name" in jsonObject) { in transformDeserialize()
22 val nameElement = jsonObject["basic-name"] ?: throw IllegalStateException() in transformDeserialize()
25 jsonObject in transformDeserialize()
Dexample-json-18.kt15 .jsonObject["forks"]!! in main()
16 .jsonArray.sumOf { it.jsonObject["votes"]?.jsonPrimitive?.int ?: 0 } in main()
/external/kotlinx.serialization/formats/json-tests/commonTest/src/kotlinx/serialization/json/serializers/
DJsonTreeTest.kt54 val third = array[2].jsonObject in testJsonObjectWithArrays()
93 assertFailsWith<NoSuchElementException> { tree.getValue("no key").jsonObject } in testExceptionalState()
95 assertEquals(null, tree["no key"]?.jsonObject) in testExceptionalState()
120 val jsonObject: Map<String, JsonElement> = JsonObject( in testThatJsonObjectsCompareWithMaps() constant
145 assertEquals(jsonObject, hashMap) in testThatJsonObjectsCompareWithMaps()
146 assertEquals(hashMap, jsonObject) in testThatJsonObjectsCompareWithMaps()
147 assertEquals(jsonObject.hashCode(), hashMap.hashCode()) in testThatJsonObjectsCompareWithMaps()
148 assertNotEquals(jsonObject, otherHashMap) in testThatJsonObjectsCompareWithMaps()
149 assertNotEquals(jsonObject, otherJsonObject) in testThatJsonObjectsCompareWithMaps()
/external/sl4a/Common/src/com/googlecode/android_scripting/rpc/
DMethodDescriptor.java243 public static Object buildIntent(JSONObject jsonObject) throws JSONException { in buildIntent() argument
245 if (jsonObject.has("action")) { in buildIntent()
246 intent.setAction(jsonObject.getString("action")); in buildIntent()
248 if (jsonObject.has("data") && jsonObject.has("type")) { in buildIntent()
249 intent.setDataAndType(Uri.parse(jsonObject.optString("data", null)), in buildIntent()
250 jsonObject.optString("type", null)); in buildIntent()
251 } else if (jsonObject.has("data")) { in buildIntent()
252 intent.setData(Uri.parse(jsonObject.optString("data", null))); in buildIntent()
253 } else if (jsonObject.has("type")) { in buildIntent()
254 intent.setType(jsonObject.optString("type", null)); in buildIntent()
[all …]
/external/json-schema-validator/src/test/java/com/networknt/schema/
DIssue575Test.java81 void testValidTimeZoneOffsets(String jsonObject) throws JsonProcessingException { in testValidTimeZoneOffsets() argument
82 Set<ValidationMessage> errors = schema.validate(new ObjectMapper().readTree(jsonObject)); in testValidTimeZoneOffsets()
123 void testInvalidTimeRepresentations(String jsonObject) throws JsonProcessingException { in testInvalidTimeRepresentations() argument
124 …Set<ValidationMessage> errors = schema.validate(new ObjectMapper().readTree(jsonObject), OutputFor… in testInvalidTimeRepresentations()
DCyclicDependencyTest.java16 String jsonObject = "{\n" + in whenDependencyBetweenSchemaThenValidationSuccessful() local
37 assertEquals(0, schema.validate(new ObjectMapper().readTree(jsonObject)).size()); in whenDependencyBetweenSchemaThenValidationSuccessful()
/external/gson/gson/src/test/java/com/google/gson/functional/
DRuntimeTypeAdapterFactoryFunctionalTest.java190 JsonObject jsonObject = delegate.toJsonTree(value).getAsJsonObject(); in create() local
191 if (!jsonObject.has(typeFieldName)) { in create()
194 for (Map.Entry<String, JsonElement> e : jsonObject.entrySet()) { in create()
197 jsonObject = clone; in create()
199 Streams.write(jsonObject, out); in create()
/external/moshi/moshi/src/test/java/com/squareup/moshi/
DMapJsonAdapterTest.java171 Map<String, Boolean> jsonObject = new LinkedHashMap<>(); in mapWithNonStringKeysToJsonObject() local
172 jsonObject.put("5", true); in mapWithNonStringKeysToJsonObject()
173 jsonObject.put("6", false); in mapWithNonStringKeysToJsonObject()
174 jsonObject.put("7", null); in mapWithNonStringKeysToJsonObject()
177 assertThat(jsonAdapter.serializeNulls().toJsonValue(map)).isEqualTo(jsonObject); in mapWithNonStringKeysToJsonObject()
178 assertThat(jsonAdapter.fromJsonValue(jsonObject)).isEqualTo(map); in mapWithNonStringKeysToJsonObject()
/external/mobly-snippet-lib/examples/ex6_complex_type_conversion/src/main/java/com/google/android/mobly/snippet/example6/
DExampleObjectConverter.java28 public Object deserialize(JSONObject jsonObject, Type type) throws JSONException { in deserialize() argument
30 return new CustomType(jsonObject.getString("Value")); in deserialize()
/external/gson/extras/src/main/java/com/google/gson/typeadapters/
DRuntimeTypeAdapterFactory.java271 JsonObject jsonObject = delegate.toJsonTree(value).getAsJsonObject(); in create() local
274 jsonElementAdapter.write(out, jsonObject); in create()
280 if (jsonObject.has(typeFieldName)) { in create()
286 for (Map.Entry<String, JsonElement> e : jsonObject.entrySet()) { in create()
/external/grpc-grpc-java/authz/src/main/java/io/grpc/authz/
DAuthorizationPolicyTranslator.java166 Object jsonObject = JsonParser.parse(authorizationPolicy); in translate() local
167 if (!(jsonObject instanceof Map)) { in translate()
170 + (jsonObject == null ? null : jsonObject.getClass())); in translate()
173 Map<String, ?> json = (Map<String, ?>)jsonObject; in translate()
/external/mobly-snippet-lib/third_party/sl4a/src/main/java/com/google/android/mobly/snippet/manager/
DSnippetObjectConverterManager.java59 public Object jsonToObject(JSONObject jsonObject, Type type) throws JSONException { in jsonToObject() argument
63 return mConverter.deserialize(jsonObject, type); in jsonToObject()
/external/kotlinx.serialization/formats/json-tests/commonTest/src/kotlinx/serialization/
DJsonElementPolymorphicErrorTest.kt40 return element.jsonObject.getValue("value") in <lambda>()
46 val value = element.jsonObject.getValue("value") in <lambda>()

123