public class Timespec extends Object implements Serializable
Value
,
Row
,
Serialized FormConstructor and Description |
---|
Timespec()
Construct a new Timespec null value.
|
Timespec(java.time.Instant value) |
Timespec(java.time.LocalDateTime value) |
Timespec(long msec)
Construct a new timespec from milliseconds.
|
Timespec(long sec,
long nsec) |
Timespec(Timestamp value) |
Modifier and Type | Method and Description |
---|---|
java.time.Instant |
asInstant()
Converts this Timespec into an
Instant . |
java.time.LocalDateTime |
asLocalDateTime()
Converts this Timespec into an
LocalDateTime . |
Timestamp |
asTimestamp()
Converts this Timespec into an sql
Timestamp . |
boolean |
equals(Object obj) |
long |
getNano() |
long |
getSec() |
boolean |
isBefore(Timespec rhs) |
boolean |
isEmpty() |
static Timespec |
max(Timespec lhs,
Timespec rhs)
Returns the smallest timespec between the two, that is, the time that is pointing
towards the latest point in time.
|
static Timespec |
min(Timespec lhs,
Timespec rhs)
Returns the smallest timespec between the two, that is, the time that is pointing
towards the earliest point in time.
|
Timespec |
minusNanos(long nanosToDeduct)
Returns copy of this instance with the specified duration in nanoseconds deducted.
|
Timespec |
minusSeconds(long secondsToDeduct)
Returns copy of this instance with the specified duration in seconds deducted.
|
static Timespec |
now()
Construct a new Timespec based on a
NanoClock that provides nanosecond
precision. |
static Timespec |
now(java.time.Clock clock)
Construct a new Timespec using your own custom Clock.
|
Timespec |
plusNanos(long nanosToAdd)
Returns copy of this instance with the specified duration in nanoseconds added.
|
Timespec |
plusSeconds(long secondsToAdd)
Returns copy of this instance with the specified duration in seconds added.
|
long |
toEpochMillis()
Converts this timespec to the number of milliseconds from the epoch of 1970-01-01
|
long |
toEpochNanos()
Converts this timespec to the number of nanoseconds from the epoch of 1970-01-01
|
String |
toString() |
public Timespec()
public Timespec(long msec)
public Timespec(long sec, long nsec)
public Timespec(java.time.LocalDateTime value)
public Timespec(Timestamp value)
public Timespec(java.time.Instant value)
public long getSec()
public long getNano()
public boolean isBefore(Timespec rhs)
public boolean isEmpty()
public static Timespec now()
NanoClock
that provides nanosecond
precision.NanoClock
public static Timespec now(java.time.Clock clock)
public Timespec plusSeconds(long secondsToAdd)
public Timespec plusNanos(long nanosToAdd)
public Timespec minusSeconds(long secondsToDeduct)
public Timespec minusNanos(long nanosToDeduct)
public java.time.Instant asInstant()
Instant
.public java.time.LocalDateTime asLocalDateTime()
LocalDateTime
.public long toEpochMillis()
public long toEpochNanos()
public static Timespec min(Timespec lhs, Timespec rhs)
Copyright © 2021. All rights reserved.