Map<String, dynamic> toMap() => { 'dir': dir, 'generators': generators?.map((i) => i.toMap()).toList(), };