fieldsForGenerator property

  1. @visibleForTesting
  2. @visibleForOverriding
String get fieldsForGenerator
inherited

Mash the element's fields into a list for serialization or deserialization

Implementation

@visibleForTesting
@visibleForOverriding
String get fieldsForGenerator {
  return fields.stableInstanceFields.fold<List<String>>(<String>[], (acc, field) {
    final fieldAnnotation = fields.annotationForField(field);
    final serialization = addField(field, fieldAnnotation);
    if (serialization != null) {
      acc.add(serialization);
    }

    return acc;
  }).join(',\n');
}