public static Tags valueOf(Map<String, MetricValue> tags) { return valueOf(tags.entrySet().stream()); }
/** * Reduce the list of tags, to only those specified in the argument set. * @param tag_names The tag names to retain. * @return A new instance of tags, which contains only tags mentioned in the argument set. */ public Tags filter(Set<String> tag_names) { return Tags.valueOf(tags_.entrySet().stream() .filter(entry -> tag_names.contains(entry.getKey()))); }
public static Tags valueOf(Map<String, MetricValue> tags) { return valueOf(tags.entrySet().stream()); }
/** * Reduce the list of tags, to only those specified in the argument set. * @param tag_names The tag names to retain. * @return A new instance of tags, which contains only tags mentioned in the argument set. */ public Tags filter(Set<String> tag_names) { return Tags.valueOf(tags_.entrySet().stream() .filter(entry -> tag_names.contains(entry.getKey()))); }
/** * Create a Tags entry with only mismatching keys. */ public static Tags mismatchingKeys(Tags in, Set<String> keys) { return Tags.valueOf(in.asMap().entrySet().stream() .filter(entry -> !keys.contains(entry.getKey()))); }
/** * Create a Tags entry with only the specified keys. */ public static Tags matchingKeys(Tags in, Set<String> keys) { return Tags.valueOf(in.asMap().entrySet().stream() .filter(entry -> keys.contains(entry.getKey()))); }
public static GroupName valueOf(SimpleGroupPath path, Stream<Map.Entry<String, MetricValue>> tags) { return valueOf(path, Tags.valueOf(tags)); }
public static GroupName valueOf(SimpleGroupPath path, Map<String, MetricValue> tags) { return valueOf(path, Tags.valueOf(tags)); }
public static Tags keepCommonTags(Tags x, Tags y) { return Tags.valueOf(x.stream() .filter(x_entry -> { return Optional.ofNullable(y.asMap().get(x_entry.getKey())) .map(x_entry.getValue()::equals) .orElse(false); })); }
public static GroupName valueOf(SimpleGroupPath path, Map<String, MetricValue> tags) { return valueOf(path, Tags.valueOf(tags)); }
public static GroupName valueOf(SimpleGroupPath path, Stream<Map.Entry<String, MetricValue>> tags) { return valueOf(path, Tags.valueOf(tags)); }