ResponseDecoder class

JsonDecoder for decoding responses from the server. This is intended to be used only for testing. Errors are reported using bare Exception objects.

Constructors

ResponseDecoder(RefactoringKind? refactoringKind)

Properties

hashCode int
The hash code for this object.
no setterinherited
refactoringKind RefactoringKind?
Retrieve the RefactoringKind that should be assumed when decoding refactoring feedback objects, or null if no refactoring feedback object is expected to be encountered.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

decodeBool(String jsonPath, Object json) bool
Decode a JSON object that is expected to be a boolean. The strings "true" and "false" are also accepted.
inherited
decodeDouble(String jsonPath, Object json) double
Decode a JSON object that is expected to be a double. A string representation of a double is also accepted.
inherited
decodeInt(String jsonPath, Object? json) int
Decode a JSON object that is expected to be an integer. A string representation of an integer is also accepted.
inherited
decodeList<E extends Object>(String jsonPath, Object? json, JsonDecoderCallback<E> decoder) List<E>
Decode a JSON object that is expected to be a List. The decoder is used to decode the items in the list.
inherited
decodeMap<K extends Object, V extends Object>(String jsonPath, Object? jsonData, {JsonDecoderCallback<K>? keyDecoder, JsonDecoderCallback<V>? valueDecoder}) Map<K, V>
Decode a JSON object that is expected to be a Map. keyDecoder is used to decode the keys, and valueDecoder is used to decode the values.
inherited
decodeString(String jsonPath, Object? json) String
Decode a JSON object that is expected to be a string.
inherited
decodeUnion(String jsonPath, Object? jsonData, String field, Map<String, JsonDecoderCallback<Object>> decoders) Object
Decode a JSON object that is expected to be one of several choices, where the choices are disambiguated by the contents of the field field. decoders is a map from each possible string in the field to the decoder that should be used to decode the JSON object.
inherited
mismatch(String jsonPath, String expected, [Object? actual]) → dynamic
Create an exception to throw if the JSON object at jsonPath fails to match the API definition of expected.
missingKey(String jsonPath, String key) → dynamic
Create an exception to throw if the JSON object at jsonPath is missing the key key.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited