Field.fromJson constructor

Field.fromJson(
  1. Map json_
)

Implementation

Field.fromJson(core.Map json_)
    : this(
        cardinality: json_.containsKey('cardinality')
            ? json_['cardinality'] as core.String
            : null,
        defaultValue: json_.containsKey('defaultValue')
            ? json_['defaultValue'] as core.String
            : null,
        jsonName: json_.containsKey('jsonName')
            ? json_['jsonName'] as core.String
            : null,
        kind: json_.containsKey('kind') ? json_['kind'] as core.String : null,
        name: json_.containsKey('name') ? json_['name'] as core.String : null,
        number:
            json_.containsKey('number') ? json_['number'] as core.int : null,
        oneofIndex: json_.containsKey('oneofIndex')
            ? json_['oneofIndex'] as core.int
            : null,
        options: json_.containsKey('options')
            ? (json_['options'] as core.List)
                .map((value) => Option.fromJson(
                    value as core.Map<core.String, core.dynamic>))
                .toList()
            : null,
        packed:
            json_.containsKey('packed') ? json_['packed'] as core.bool : null,
        typeUrl: json_.containsKey('typeUrl')
            ? json_['typeUrl'] as core.String
            : null,
      );