generate method

String generate(
  1. GeneratorData data
)

This function is the main class to generate the mapper classes

Implementation

String generate(GeneratorData data) {
  String className = data.className?.capitalizeFirst ?? Strings.unnamedClass;
  variables = data.variablesList ?? [];
  String code = '';
  code += AddCode.addCommentLine('  ==> Entity to Model Mapper Extension');
  code += _addMapper(className: className, firstType: AnnotationTypes.entity, secondType: AnnotationTypes.model);
  code += AddCode.addCommentLine('  ==> Model to Entity Mapper Extension');
  code += _addMapper(className: className, firstType: AnnotationTypes.model, secondType: AnnotationTypes.entity);
  return code;
}