allInstanceFieldsAndMethods property

String get allInstanceFieldsAndMethods

Any special instance fields the serdes generator needs to forward to the adapter

Implementation

String get allInstanceFieldsAndMethods {
  return generators.fold<Set<String>>(<String>{}, (acc, generator) {
    final fromGenerator =
        generator.instanceFieldsAndMethods.fold<Set<String>>(<String>{}, (acc2, field) {
      final didAdd = acc2.add(field);
      if (!didAdd) {
        throw InvalidGenerationSourceError(
          '$field has already been declared by another generator',
        );
      }
      return acc2;
    });
    acc.addAll(fromGenerator);
    return acc;
  }).join('\n');
}