@Test void addTags() { HashMap<String, String> tags = new HashMap<>(); tags.put("type", "production"); tags.put("location", "europe"); tags.put("expensive", ""); Point point = Point.measurement("h2o") .addField("level", 2) .addTags(tags); Assertions.assertThat(point.toLineProtocol()).isEqualTo("h2o,location=europe,type=production level=2i"); }
@Nonnull public Point addTags(@Nonnull final Map<String, String> tagsToAdd) { Arguments.checkNotNull(tagsToAdd, "tagsToAdd"); tagsToAdd.forEach(this::addTag); return this; }
Point { @Nonnull public Point addTags(@Nonnull final Map<String, String> tagsToAdd) { Arguments.checkNotNull(tagsToAdd, "tagsToAdd"); tagsToAdd.forEach(this::addTag); return this; } }
Point { @Nonnull public Point addTags(@Nonnull final Map<String, String> tagsToAdd) { Arguments.checkNotNull(tagsToAdd, "tagsToAdd"); tagsToAdd.forEach(this::addTag); return this; } Point(@Nonnull final String measurementName); }
Point { @Nonnull public Point addTags(@Nonnull final Map<String, String> tagsToAdd) { Arguments.checkNotNull(tagsToAdd, "tagsToAdd"); tagsToAdd.forEach(this::addTag); return this; } Point(@Nonnull final String measurementName); @Nonnull static Point measurement(@Nonnull final String measurementName); @Nonnull Point addTag(@Nonnull final String key, @Nullable final String value); @Nonnull Point addTags(@Nonnull final Map<String, String> tagsToAdd); @Nonnull Point addField(@Nonnull final String field, final boolean value); Point addField(@Nonnull final String field, final long value); @Nonnull Point addField(@Nonnull final String field, final double value); @Nonnull Point addField(@Nonnull final String field, @Nullable final Number value); @Nonnull Point addField(@Nonnull final String field, @Nullable final String value); @Nonnull Point addFields(@Nonnull final Map<String, Object> fieldsToAdd); @Nonnull Point time(@Nullable final Instant time, @Nonnull final WritePrecision precision); @Nonnull Point time(@Nullable final Number time, @Nonnull final WritePrecision precision); @Nonnull Point time(@Nullable final Long time, @Nonnull final WritePrecision precision); @Nonnull WritePrecision getPrecision(); boolean hasFields(); @Nonnull String toLineProtocol(); @Nonnull String toLineProtocol(@Nullable final PointSettings pointSettings); }
Point { @Nonnull public Point addTags(@Nonnull final Map<String, String> tagsToAdd) { Arguments.checkNotNull(tagsToAdd, "tagsToAdd"); tagsToAdd.forEach(this::addTag); return this; } Point(@Nonnull final String measurementName); @Nonnull static Point measurement(@Nonnull final String measurementName); @Nonnull Point addTag(@Nonnull final String key, @Nullable final String value); @Nonnull Point addTags(@Nonnull final Map<String, String> tagsToAdd); @Nonnull Point addField(@Nonnull final String field, final boolean value); Point addField(@Nonnull final String field, final long value); @Nonnull Point addField(@Nonnull final String field, final double value); @Nonnull Point addField(@Nonnull final String field, @Nullable final Number value); @Nonnull Point addField(@Nonnull final String field, @Nullable final String value); @Nonnull Point addFields(@Nonnull final Map<String, Object> fieldsToAdd); @Nonnull Point time(@Nullable final Instant time, @Nonnull final WritePrecision precision); @Nonnull Point time(@Nullable final Number time, @Nonnull final WritePrecision precision); @Nonnull Point time(@Nullable final Long time, @Nonnull final WritePrecision precision); @Nonnull WritePrecision getPrecision(); boolean hasFields(); @Nonnull String toLineProtocol(); @Nonnull String toLineProtocol(@Nullable final PointSettings pointSettings);  }