Entity.fromJson constructor

Entity.fromJson(
  1. Map json_
)

Implementation

Entity.fromJson(core.Map json_)
    : this(
        mentions: json_.containsKey('mentions')
            ? (json_['mentions'] as core.List)
                .map((value) => EntityMention.fromJson(
                    value as core.Map<core.String, core.dynamic>))
                .toList()
            : null,
        metadata: json_.containsKey('metadata')
            ? (json_['metadata'] as core.Map<core.String, core.dynamic>).map(
                (key, value) => core.MapEntry(
                  key,
                  value as core.String,
                ),
              )
            : null,
        name: json_.containsKey('name') ? json_['name'] as core.String : null,
        sentiment: json_.containsKey('sentiment')
            ? Sentiment.fromJson(
                json_['sentiment'] as core.Map<core.String, core.dynamic>)
            : null,
        type: json_.containsKey('type') ? json_['type'] as core.String : null,
      );