@Test public void filter() { final Tags tags = Tags.valueOf(singletonMap("fizz", MetricValue.fromStrValue("bar"))); assertThat(tags.filter(singleton("fizz")).asMap(), hasEntry("fizz", MetricValue.fromStrValue("bar"))); assertThat(tags.filter(singleton("buzz")).asMap(), not(hasEntry("fizz", MetricValue.fromStrValue("bar")))); }
public Tags filter(Set<String> tag_names) { return Tags.valueOf(tags_.entrySet().stream() .filter(entry -> tag_names.contains(entry.getKey()))); }
Tags implements Comparable<Tags> { public Tags filter(Set<String> tag_names) { return Tags.valueOf(tags_.entrySet().stream() .filter(entry -> tag_names.contains(entry.getKey()))); } }
Tags implements Comparable<Tags> { public Tags filter(Set<String> tag_names) { return Tags.valueOf(tags_.entrySet().stream() .filter(entry -> tag_names.contains(entry.getKey()))); } private  Tags(Key tags); }
Tags implements Comparable<Tags> { public Tags filter(Set<String> tag_names) { return Tags.valueOf(tags_.entrySet().stream() .filter(entry -> tag_names.contains(entry.getKey()))); } private  Tags(Key tags); static Tags valueOf(Stream<Map.Entry<String, MetricValue>> tags); static Tags valueOf(Map<String, MetricValue> tags); Map<String, MetricValue> asMap(); boolean isEmpty(); boolean contains(String tag); Iterator<Map.Entry<String, MetricValue>> iterator(); Optional<MetricValue> getTag(String key); Stream<Map.Entry<String, MetricValue>> stream(); String getTagString(); Tags filter(Set<String> tag_names); @Override int hashCode(); @Override boolean equals(Object obj); @Override int compareTo(Tags other); @Override String toString(); }
Tags implements Comparable<Tags> { public Tags filter(Set<String> tag_names) { return Tags.valueOf(tags_.entrySet().stream() .filter(entry -> tag_names.contains(entry.getKey()))); } private  Tags(Key tags); static Tags valueOf(Stream<Map.Entry<String, MetricValue>> tags); static Tags valueOf(Map<String, MetricValue> tags); Map<String, MetricValue> asMap(); boolean isEmpty(); boolean contains(String tag); Iterator<Map.Entry<String, MetricValue>> iterator(); Optional<MetricValue> getTag(String key); Stream<Map.Entry<String, MetricValue>> stream(); String getTagString(); Tags filter(Set<String> tag_names); @Override int hashCode(); @Override boolean equals(Object obj); @Override int compareTo(Tags other); @Override String toString(); static final Tags EMPTY; }