deserialize static method

Descendant deserialize(
  1. Map<String, String> json,
  2. DeserializeFinderFactory finderFactory
)

Deserializes the finder from JSON generated by serialize.

Implementation

static Descendant deserialize(Map<String, String> json, DeserializeFinderFactory finderFactory) {
  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: finderFactory.deserializeFinder(jsonOfMatcher),
    matching: finderFactory.deserializeFinder(jsonMatchingMatcher),
    matchRoot: json['matchRoot'] == 'true',
    firstMatchOnly: json['firstMatchOnly'] == 'true',
  );
}