trphoenix
2018-11-29 25f4612acc6885d3f977c16252e2185b874b3394
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
// GENERATED CODE - DO NOT MODIFY BY HAND
 
part of 'generic_class.wrapped.dart';
 
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
 
GenericClass<T, S> _$GenericClassFromJson<T extends num, S>(
    Map<String, dynamic> json) {
  return GenericClass<T, S>()
    ..fieldObject = json['fieldObject'] == null
        ? null
        : GenericClass._dataFromJson(
            json['fieldObject'] as Map<String, dynamic>)
    ..fieldDynamic = json['fieldDynamic'] == null
        ? null
        : GenericClass._dataFromJson(
            json['fieldDynamic'] as Map<String, dynamic>)
    ..fieldInt = json['fieldInt'] == null
        ? null
        : GenericClass._dataFromJson(json['fieldInt'] as Map<String, dynamic>)
    ..fieldT = json['fieldT'] == null
        ? null
        : GenericClass._dataFromJson(json['fieldT'] as Map<String, dynamic>)
    ..fieldS = json['fieldS'] == null
        ? null
        : GenericClass._dataFromJson(json['fieldS'] as Map<String, dynamic>);
}
 
Map<String, dynamic> _$GenericClassToJson<T extends num, S>(
        GenericClass<T, S> instance) =>
    _$GenericClassJsonMapWrapper<T, S>(instance);
 
class _$GenericClassJsonMapWrapper<T extends num, S> extends $JsonMapWrapper {
  final GenericClass<T, S> _v;
  _$GenericClassJsonMapWrapper(this._v);
 
  @override
  Iterable<String> get keys =>
      const ['fieldObject', 'fieldDynamic', 'fieldInt', 'fieldT', 'fieldS'];
 
  @override
  dynamic operator [](Object key) {
    if (key is String) {
      switch (key) {
        case 'fieldObject':
          return _v.fieldObject == null
              ? null
              : GenericClass._dataToJson(_v.fieldObject);
        case 'fieldDynamic':
          return _v.fieldDynamic == null
              ? null
              : GenericClass._dataToJson(_v.fieldDynamic);
        case 'fieldInt':
          return _v.fieldInt == null
              ? null
              : GenericClass._dataToJson(_v.fieldInt);
        case 'fieldT':
          return _v.fieldT == null ? null : GenericClass._dataToJson(_v.fieldT);
        case 'fieldS':
          return _v.fieldS == null ? null : GenericClass._dataToJson(_v.fieldS);
      }
    }
    return null;
  }
}
 
GenericClassWithConverter<T, S>
    _$GenericClassWithConverterFromJson<T extends num, S>(
        Map<String, dynamic> json) {
  return GenericClassWithConverter<T, S>()
    ..fieldObject = json['fieldObject']
    ..fieldDynamic = json['fieldDynamic']
    ..fieldInt = json['fieldInt'] as int
    ..fieldT = json['fieldT'] == null
        ? null
        : _SimpleConverter<T>().fromJson(json['fieldT'] as Map<String, dynamic>)
    ..fieldS = json['fieldS'] == null
        ? null
        : _SimpleConverter<S>().fromJson(json['fieldS'] as Map<String, dynamic>)
    ..duration = json['duration'] == null
        ? null
        : const _DurationMillisecondConverter()
            .fromJson(json['duration'] as int)
    ..listDuration = json['listDuration'] == null
        ? null
        : const _DurationListMillisecondConverter()
            .fromJson(json['listDuration'] as int);
}
 
Map<String, dynamic> _$GenericClassWithConverterToJson<T extends num, S>(
        GenericClassWithConverter<T, S> instance) =>
    _$GenericClassWithConverterJsonMapWrapper<T, S>(instance);
 
class _$GenericClassWithConverterJsonMapWrapper<T extends num, S>
    extends $JsonMapWrapper {
  final GenericClassWithConverter<T, S> _v;
  _$GenericClassWithConverterJsonMapWrapper(this._v);
 
  @override
  Iterable<String> get keys => const [
        'fieldObject',
        'fieldDynamic',
        'fieldInt',
        'fieldT',
        'fieldS',
        'duration',
        'listDuration'
      ];
 
  @override
  dynamic operator [](Object key) {
    if (key is String) {
      switch (key) {
        case 'fieldObject':
          return _v.fieldObject;
        case 'fieldDynamic':
          return _v.fieldDynamic;
        case 'fieldInt':
          return _v.fieldInt;
        case 'fieldT':
          return _v.fieldT == null
              ? null
              : _SimpleConverter<T>().toJson(_v.fieldT);
        case 'fieldS':
          return _v.fieldS == null
              ? null
              : _SimpleConverter<S>().toJson(_v.fieldS);
        case 'duration':
          return _v.duration == null
              ? null
              : const _DurationMillisecondConverter().toJson(_v.duration);
        case 'listDuration':
          return _v.listDuration == null
              ? null
              : const _DurationListMillisecondConverter()
                  .toJson(_v.listDuration);
      }
    }
    return null;
  }
}