influxdb-java icon indicating copy to clipboard operation
influxdb-java copied to clipboard

Point should have accessor for time

Open ioreskovic opened this issue 6 years ago • 2 comments

Point carries information about time instant, but offers no way to access it (which is sometimes needed). Otherwise, we need to wrap Points with time information, thus, duplicating it.

Proposed method signature:

public Instant utcTime() {
    // return based upon time value and precision
}

ioreskovic avatar Aug 29 '18 09:08 ioreskovic

Wouldn't the signature more likely be

public Long getTime() {
    return time; //return of long provided to most recent call to setTime or null
}

or

public Optional<Long> getTime() {
    //same return as above inside Optional except Optional.empty() instead of null
}

It isn't influxDb's job to assign meaning to time or time zone.

Perhaps what is needed is to compare to two Point times within precision with a compare method.

tomprodehl avatar Sep 12 '18 21:09 tomprodehl

@tomprodehl Yes, of course :D

ioreskovic avatar Sep 13 '18 06:09 ioreskovic