platform/angel_serialize_generator/test/models/with_enum.serializer.g.dart

39 lines
1 KiB
Dart
Raw Normal View History

2018-06-27 05:36:57 +00:00
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'with_enum.dart';
// **************************************************************************
2018-06-29 04:11:57 +00:00
// SerializerGenerator
2018-06-27 05:36:57 +00:00
// **************************************************************************
abstract class WithEnumSerializer {
static WithEnum fromMap(Map map) {
return new WithEnum(
type: map['type'] is WithEnumType
2018-07-11 13:06:03 +00:00
? (map['type'] as WithEnumType)
: (map['type'] is int
? WithEnumType.values[map['type'] as int]
: null),
2018-06-27 05:45:46 +00:00
finalList: map['final_list'] as List<int>);
2018-06-27 05:36:57 +00:00
}
static Map<String, dynamic> toMap(WithEnum model) {
2018-06-28 01:58:42 +00:00
if (model == null) {
return null;
}
2018-06-27 05:36:57 +00:00
return {
'type':
2018-06-27 05:45:46 +00:00
model.type == null ? null : WithEnumType.values.indexOf(model.type),
'final_list': model.finalList
2018-06-27 05:36:57 +00:00
};
}
}
abstract class WithEnumFields {
2018-07-11 15:49:46 +00:00
static const List<String> allFields = const <String>[type, finalList];
2018-06-27 05:36:57 +00:00
static const String type = 'type';
2018-06-27 05:45:46 +00:00
static const String finalList = 'final_list';
2018-06-27 05:36:57 +00:00
}