Distribution.fromJson constructor

Distribution.fromJson(
  1. Map json_
)

Implementation

Distribution.fromJson(core.Map json_)
    : this(
        bucketCounts: json_.containsKey('bucketCounts')
            ? (json_['bucketCounts'] as core.List)
                .map((value) => value as core.String)
                .toList()
            : null,
        count:
            json_.containsKey('count') ? json_['count'] as core.String : null,
        exemplars: json_.containsKey('exemplars')
            ? (json_['exemplars'] as core.List)
                .map((value) => Exemplar.fromJson(
                    value as core.Map<core.String, core.dynamic>))
                .toList()
            : null,
        explicitBuckets: json_.containsKey('explicitBuckets')
            ? ExplicitBuckets.fromJson(json_['explicitBuckets']
                as core.Map<core.String, core.dynamic>)
            : null,
        exponentialBuckets: json_.containsKey('exponentialBuckets')
            ? ExponentialBuckets.fromJson(json_['exponentialBuckets']
                as core.Map<core.String, core.dynamic>)
            : null,
        linearBuckets: json_.containsKey('linearBuckets')
            ? LinearBuckets.fromJson(
                json_['linearBuckets'] as core.Map<core.String, core.dynamic>)
            : null,
        maximum: json_.containsKey('maximum')
            ? (json_['maximum'] as core.num).toDouble()
            : null,
        mean: json_.containsKey('mean')
            ? (json_['mean'] as core.num).toDouble()
            : null,
        minimum: json_.containsKey('minimum')
            ? (json_['minimum'] as core.num).toDouble()
            : null,
        sumOfSquaredDeviation: json_.containsKey('sumOfSquaredDeviation')
            ? (json_['sumOfSquaredDeviation'] as core.num).toDouble()
            : null,
      );