deserialize method

Descendant deserialize (
  1. Map<String, String> json
)
override

Deserializes the finder from JSON generated by serialize.

Implementation

static Descendant deserialize(Map<String, String> json) {
  final Map<String, String> jsonOfMatcher =
      Map<String, String>.from(jsonDecode(json['of']) as Map<String, dynamic>);
  final Map<String, String> jsonMatchingMatcher =
      Map<String, String>.from(jsonDecode(json['matching']) as Map<String, dynamic>);
  return Descendant(
    of: SerializableFinder.deserialize(jsonOfMatcher),
    matching: SerializableFinder.deserialize(jsonMatchingMatcher),
    matchRoot: json['matchRoot'] == 'true',
    firstMatchOnly: json['firstMatchOnly'] == 'true',
  );
}