fromJson static method
Returns a new ModemNetworkBearerIp4Config instance and imports its values from
value if it's a Map, null otherwise.
Implementation
// ignore: prefer_constructors_over_static_methods
static ModemNetworkBearerIp4Config? fromJson(dynamic value) {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
requiredKeys.forEach((key) {
assert(json.containsKey(key),
'Required key "ModemNetworkBearerIp4Config[$key]" is missing from JSON.');
assert(json[key] != null,
'Required key "ModemNetworkBearerIp4Config[$key]" has a null value in JSON.');
});
return true;
}());
return ModemNetworkBearerIp4Config(
method: json[r'method'] == null
? null
: num.parse(json[r'method'].toString()),
address: mapValueOfType<String>(json, r'address'),
prefix: json[r'prefix'] == null
? null
: num.parse(json[r'prefix'].toString()),
dns1: mapValueOfType<String>(json, r'dns1'),
dns2: mapValueOfType<String>(json, r'dns2'),
gateway: mapValueOfType<String>(json, r'gateway'),
mtu: json[r'mtu'] == null ? null : num.parse(json[r'mtu'].toString()),
);
}
return null;
}