@Test public void map_is_not_shared() { Map<MetricName, MetricValue> local = new HashMap<>(values); TimeSeriesValue tsv = new MutableTimeSeriesValue(group_name, local); local.remove(metric_key); assertEquals(values, new HashMap<>(tsv.getMetrics())); }
@Override public Map<MetricName, MetricValue> getMetrics() { return unmodifiableMap(metrics_); }
MutableTimeSeriesValue extends AbstractTimeSeriesValue implements TimeSeriesValue { @Override public Map<MetricName, MetricValue> getMetrics() { return unmodifiableMap(metrics_); } }
MutableTimeSeriesValue extends AbstractTimeSeriesValue implements TimeSeriesValue { @Override public Map<MetricName, MetricValue> getMetrics() { return unmodifiableMap(metrics_); } MutableTimeSeriesValue(GroupName group);  MutableTimeSeriesValue(GroupName group, Map<? extends MetricName, ? extends MetricValue> metrics); <T> MutableTimeSeriesValue(GroupName group, Stream<T> metric_stream, Function<T, MetricName> name_fn, Function<T, MetricValue> value_fn);  MutableTimeSeriesValue(TimeSeriesValue tsv); }
MutableTimeSeriesValue extends AbstractTimeSeriesValue implements TimeSeriesValue { @Override public Map<MetricName, MetricValue> getMetrics() { return unmodifiableMap(metrics_); } MutableTimeSeriesValue(GroupName group);  MutableTimeSeriesValue(GroupName group, Map<? extends MetricName, ? extends MetricValue> metrics); <T> MutableTimeSeriesValue(GroupName group, Stream<T> metric_stream, Function<T, MetricName> name_fn, Function<T, MetricValue> value_fn);  MutableTimeSeriesValue(TimeSeriesValue tsv); @Override GroupName getGroup(); MutableTimeSeriesValue setGroup(GroupName group); @Override Map<MetricName, MetricValue> getMetrics(); MutableTimeSeriesValue addMetric(MetricName name, MetricValue value); MutableTimeSeriesValue addMetrics(Map<? extends MetricName, ? extends MetricValue> values); MutableTimeSeriesValue addMetrics(Stream<T> values, Function<? super T, ? extends MetricName> name_fn, Function<? super T, ? extends MetricValue> value_fn); @Override MutableTimeSeriesValue clone(); }
MutableTimeSeriesValue extends AbstractTimeSeriesValue implements TimeSeriesValue { @Override public Map<MetricName, MetricValue> getMetrics() { return unmodifiableMap(metrics_); } MutableTimeSeriesValue(GroupName group);  MutableTimeSeriesValue(GroupName group, Map<? extends MetricName, ? extends MetricValue> metrics); <T> MutableTimeSeriesValue(GroupName group, Stream<T> metric_stream, Function<T, MetricName> name_fn, Function<T, MetricValue> value_fn);  MutableTimeSeriesValue(TimeSeriesValue tsv); @Override GroupName getGroup(); MutableTimeSeriesValue setGroup(GroupName group); @Override Map<MetricName, MetricValue> getMetrics(); MutableTimeSeriesValue addMetric(MetricName name, MetricValue value); MutableTimeSeriesValue addMetrics(Map<? extends MetricName, ? extends MetricValue> values); MutableTimeSeriesValue addMetrics(Stream<T> values, Function<? super T, ? extends MetricName> name_fn, Function<? super T, ? extends MetricValue> value_fn); @Override MutableTimeSeriesValue clone();  }