Class NanosecondConverter

java.lang.Object
com.influxdb.v3.client.internal.NanosecondConverter

public final class NanosecondConverter extends Object
Nanosecond converter.

Utility class converting epoch nanoseconds to epoch with a given precision.

  • Method Details

    • convertToNanos

      @Nullable public static BigInteger convertToNanos(@Nullable Number timestamp, WritePrecision precision)
      Convert timestamp in a given precision to nanoseconds.
      Parameters:
      timestamp - epoch timestamp
      precision - precision
      Returns:
      epoch timestamp in precision, can be null
    • convert

      public static BigInteger convert(Instant instant, WritePrecision precision)
      Convert Instant timestamp to a given precision.
      Parameters:
      instant - Instant timestamp
      precision - precision
      Returns:
      epoch timestamp in precision