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 json_rpc_2.parameters; | |
6 | |
7 import 'dart:convert'; | 5 import 'dart:convert'; |
8 | 6 |
9 import 'exception.dart'; | 7 import 'exception.dart'; |
10 | 8 |
11 /// A wrapper for the parameters to a server method. | 9 /// A wrapper for the parameters to a server method. |
12 /// | 10 /// |
13 /// JSON-RPC 2.0 allows parameters that are either a list or a map. This class | 11 /// JSON-RPC 2.0 allows parameters that are either a list or a map. This class |
14 /// provides functions that not only assert that the parameters object is the | 12 /// provides functions that not only assert that the parameters object is the |
15 /// correct type, but also that the expected arguments exist and are themselves | 13 /// correct type, but also that the expected arguments exist and are themselves |
16 /// the correct type. | 14 /// the correct type. |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 String asStringOr(String defaultValue) => defaultValue; | 323 String asStringOr(String defaultValue) => defaultValue; |
326 | 324 |
327 List asListOr(List defaultValue) => defaultValue; | 325 List asListOr(List defaultValue) => defaultValue; |
328 | 326 |
329 Map asMapOr(Map defaultValue) => defaultValue; | 327 Map asMapOr(Map defaultValue) => defaultValue; |
330 | 328 |
331 DateTime asDateTimeOr(DateTime defaultValue) => defaultValue; | 329 DateTime asDateTimeOr(DateTime defaultValue) => defaultValue; |
332 | 330 |
333 Uri asUriOr(Uri defaultValue) => defaultValue; | 331 Uri asUriOr(Uri defaultValue) => defaultValue; |
334 } | 332 } |
OLD | NEW |