@Immutable public abstract static class SpanData.Timestamp extends Object
Defined here instead of using Instant because the API needs to be Java 1.7
compatible.
| Modifier and Type | Method and Description |
|---|---|
static SpanData.Timestamp |
create(long seconds,
int nanos)
Creates a new timestamp from given seconds and nanoseconds.
|
static SpanData.Timestamp |
fromMillis(long epochMilli)
Creates a new timestamp from the given milliseconds.
|
abstract int |
getNanos()
Returns the number of nanoseconds after the number of seconds since the Unix Epoch
represented by this timestamp.
|
abstract long |
getSeconds()
Returns the number of seconds since the Unix Epoch represented by this timestamp.
|
public static SpanData.Timestamp create(long seconds, int nanos)
seconds - Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must be
from from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.nanos - Non-negative fractions of a second at nanosecond resolution. Negative second
values with fractions must still have non-negative nanos values that count forward in
time. Must be from 0 to 999,999,999 inclusive.Timestamp with specified fields.IllegalArgumentException - if the arguments are out of range.public static SpanData.Timestamp fromMillis(long epochMilli)
epochMilli - the timestamp represented in milliseconds since epoch.Timestamp with specified fields.IllegalArgumentException - if the number of milliseconds is out of the range that can
be represented by Timestamp.public abstract long getSeconds()
public abstract int getNanos()