Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library protocol; | 5 library protocol; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 import 'dart:convert' show JsonDecoder; | 8 import 'dart:convert' show JsonDecoder; |
| 9 | 9 |
| 10 /** | 10 /** |
| (...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 394 * Validate that the datum is a map from strings to string listss, and return | 394 * Validate that the datum is a map from strings to string listss, and return |
| 395 * it. | 395 * it. |
| 396 */ | 396 */ |
| 397 Map<String, List<String>> asStringListMap() { | 397 Map<String, List<String>> asStringListMap() { |
| 398 if (!isStringListMap()) { | 398 if (!isStringListMap()) { |
| 399 throw new RequestFailure(new Response.invalidParameter(request, path, | 399 throw new RequestFailure(new Response.invalidParameter(request, path, |
| 400 "be a string list map")); | 400 "be a string list map")); |
| 401 } | 401 } |
| 402 return datum; | 402 return datum; |
| 403 } | 403 } |
| 404 | |
| 405 bool get isNull => datum == null; | |
|
scheglov
2014/06/13 16:55:53
Should we add a documentation for it?
Paul Berry
2014/06/13 20:23:00
I couldn't think of a documentation comment that w
| |
| 404 } | 406 } |
| 405 | 407 |
| 406 /** | 408 /** |
| 407 * Instances of the class [Response] represent a response to a request. | 409 * Instances of the class [Response] represent a response to a request. |
| 408 */ | 410 */ |
| 409 class Response { | 411 class Response { |
| 410 /** | 412 /** |
| 411 * The name of the JSON attribute containing the id of the request for which | 413 * The name of the JSON attribute containing the id of the request for which |
| 412 * this is a response. | 414 * this is a response. |
| 413 */ | 415 */ |
| (...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 842 /** | 844 /** |
| 843 * The response to be returned as a result of the failure. | 845 * The response to be returned as a result of the failure. |
| 844 */ | 846 */ |
| 845 final Response response; | 847 final Response response; |
| 846 | 848 |
| 847 /** | 849 /** |
| 848 * Initialize a newly created exception to return the given reponse. | 850 * Initialize a newly created exception to return the given reponse. |
| 849 */ | 851 */ |
| 850 RequestFailure(this.response); | 852 RequestFailure(this.response); |
| 851 } | 853 } |
| OLD | NEW |