Class Point

java.lang.Object
com.influxdb.client.write.Point

@NotThreadSafe public final class Point extends Object
Point defines the values that will be written to the database. See Go Implementation.
Author:
Jakub Bednar (bednar@github) (11/10/2018 11:40)
  • Constructor Details

    • Point

      public Point(@Nonnull String measurementName)
      Create a new Point with specified a measurement name.
      Parameters:
      measurementName - the measurement name
  • Method Details

    • measurement

      @Nonnull public static Point measurement(@Nonnull String measurementName)
      Create a new Point withe specified a measurement name.
      Parameters:
      measurementName - the measurement name
      Returns:
      new instance of Point
    • addTag

      @Nonnull public Point addTag(@Nonnull String key, @Nullable String value)
      Adds or replaces a tag value for this point.
      Parameters:
      key - the tag name
      value - the tag value
      Returns:
      this
    • addTags

      @Nonnull public Point addTags(@Nonnull Map<String,String> tagsToAdd)
      Adds or replaces tags for this point.
      Parameters:
      tagsToAdd - the Map of tags to add
      Returns:
      this
    • addField

      @Nonnull public Point addField(@Nonnull String field, boolean value)
      Add Boolean field.
      Parameters:
      field - the field name
      value - the field value
      Returns:
      this
    • addField

      public Point addField(@Nonnull String field, long value)
      Add Long field.
      Parameters:
      field - the field name
      value - the field value
      Returns:
      this
    • addField

      @Nonnull public Point addField(@Nonnull String field, double value)
      Add Double field.
      Parameters:
      field - the field name
      value - the field value
      Returns:
      this
    • addField

      @Nonnull public Point addField(@Nonnull String field, @Nullable Number value)
      Add Number field.
      Parameters:
      field - the field name
      value - the field value
      Returns:
      this
    • addField

      @Nonnull public Point addField(@Nonnull String field, @Nullable String value)
      Add String field.
      Parameters:
      field - the field name
      value - the field value
      Returns:
      this
    • addFields

      @Nonnull public Point addFields(@Nonnull Map<String,Object> fieldsToAdd)
      Adds or replaces fields for this point.
      Parameters:
      fieldsToAdd - the Map of fields to add
      Returns:
      this
    • time

      @Nonnull public Point time(@Nullable Instant time, @Nonnull WritePrecision precision)
      Updates the timestamp for the point.
      Parameters:
      time - the timestamp
      precision - the timestamp precision
      Returns:
      this
    • time

      @Nonnull public Point time(@Nullable Number time, @Nonnull WritePrecision precision)
      Updates the timestamp for the point.
      Parameters:
      time - the timestamp
      precision - the timestamp precision
      Returns:
      this
    • time

      @Nonnull public Point time(@Nullable Long time, @Nonnull WritePrecision precision)
      Updates the timestamp for the point.
      Parameters:
      time - the timestamp
      precision - the timestamp precision
      Returns:
      this
    • getTime

      @Nullable public Number getTime()
      Returns:
      the data point timestamp
    • getPrecision

      @Nonnull public WritePrecision getPrecision()
      Returns:
      the data point precision
    • hasFields

      public boolean hasFields()
      Has point any fields?
      Returns:
      true, if the point contains any fields, false otherwise.
    • toLineProtocol

      @Nonnull public String toLineProtocol()
      Returns:
      Line Protocol
    • toLineProtocol

      @Nonnull public String toLineProtocol(@Nullable PointSettings pointSettings)
      Parameters:
      pointSettings - with the default values
      Returns:
      Line Protocol
    • toLineProtocol

      @Nonnull public String toLineProtocol(@Nullable PointSettings pointSettings, @Nonnull WritePrecision precision)
      Parameters:
      pointSettings - with the default values
      precision - required precision
      Returns:
      Line Protocol