@NotThreadSafe public final class Point extends Object
Constructor and Description |
---|
Point(String measurementName)
Create a new Point with specified a measurement name.
|
Modifier and Type | Method and Description |
---|---|
Point |
addField(String field,
boolean value)
Add
Boolean field. |
Point |
addField(String field,
double value)
Add
Double field. |
Point |
addField(String field,
long value)
Add
Long field. |
Point |
addField(String field,
Number value)
Add
Number field. |
Point |
addField(String field,
String value)
Add
String field. |
Point |
addFields(Map<String,Object> fieldsToAdd)
Adds or replaces fields for this point.
|
Point |
addTag(String key,
String value)
Adds or replaces a tag value for this point.
|
Point |
addTags(Map<String,String> tagsToAdd)
Adds or replaces tags for this point.
|
WritePrecision |
getPrecision() |
boolean |
hasFields()
Has point any fields?
|
static Point |
measurement(String measurementName)
Create a new Point withe specified a measurement name.
|
Point |
time(Instant time,
WritePrecision precision)
Updates the timestamp for the point.
|
Point |
time(Long time,
WritePrecision precision)
Updates the timestamp for the point.
|
Point |
time(Number time,
WritePrecision precision)
Updates the timestamp for the point.
|
String |
toLineProtocol() |
String |
toLineProtocol(PointSettings pointSettings) |
@Nonnull public static Point measurement(@Nonnull String measurementName)
measurementName
- the measurement namePoint
@Nonnull public Point addTag(@Nonnull String key, @Nullable String value)
key
- the tag namevalue
- the tag value@Nonnull public Point addTags(@Nonnull Map<String,String> tagsToAdd)
tagsToAdd
- the Map of tags to add@Nonnull public Point addField(@Nonnull String field, boolean value)
Boolean
field.field
- the field namevalue
- the field valuepublic Point addField(@Nonnull String field, long value)
Long
field.field
- the field namevalue
- the field value@Nonnull public Point addField(@Nonnull String field, double value)
Double
field.field
- the field namevalue
- the field value@Nonnull public Point addField(@Nonnull String field, @Nullable Number value)
Number
field.field
- the field namevalue
- the field value@Nonnull public Point addField(@Nonnull String field, @Nullable String value)
String
field.field
- the field namevalue
- the field value@Nonnull public Point addFields(@Nonnull Map<String,Object> fieldsToAdd)
fieldsToAdd
- the Map of fields to add@Nonnull public Point time(@Nullable Instant time, @Nonnull WritePrecision precision)
time
- the timestampprecision
- the timestamp precision@Nonnull public Point time(@Nullable Number time, @Nonnull WritePrecision precision)
time
- the timestampprecision
- the timestamp precision@Nonnull public Point time(@Nullable Long time, @Nonnull WritePrecision precision)
time
- the timestampprecision
- the timestamp precision@Nonnull public WritePrecision getPrecision()
public boolean hasFields()
@Nonnull public String toLineProtocol(@Nullable PointSettings pointSettings)
pointSettings
- with the default valuesCopyright © 2018–2021 InfluxData, Inc.. All rights reserved.