Package io.temporal.internal.common
Class ProtobufTimeUtils
- java.lang.Object
-
- io.temporal.internal.common.ProtobufTimeUtils
-
public class ProtobufTimeUtils extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description ProtobufTimeUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static com.google.protobuf.Timestamp
getCurrentProtoTime()
static java.time.Duration
toJavaDuration(com.google.protobuf.Duration d)
Converts a Protobuf Duration to a Java Duration with millisecond precision.static java.time.Instant
toJavaInstant(com.google.protobuf.Timestamp t)
static com.uber.m3.util.Duration
toM3Duration(com.google.protobuf.Timestamp to, com.google.protobuf.Timestamp from)
static com.uber.m3.util.Duration
toM3DurationSinceNow(com.google.protobuf.Timestamp t)
static com.google.protobuf.Duration
toProtoDuration(java.time.Duration d)
Converts a Java Duration to a Protobuf Duration with millisecond precision.static com.google.protobuf.Timestamp
toProtoTimestamp(java.time.Instant t)
-
-
-
Method Detail
-
toJavaDuration
@Nonnull public static java.time.Duration toJavaDuration(@Nullable com.google.protobuf.Duration d)
Converts a Protobuf Duration to a Java Duration with millisecond precision. Null inputs are treated as zero.
-
toProtoDuration
@Nonnull public static com.google.protobuf.Duration toProtoDuration(@Nullable java.time.Duration d)
Converts a Java Duration to a Protobuf Duration with millisecond precision. Null inputs are treated as zero.
-
getCurrentProtoTime
public static com.google.protobuf.Timestamp getCurrentProtoTime()
-
toM3Duration
public static com.uber.m3.util.Duration toM3Duration(com.google.protobuf.Timestamp to, com.google.protobuf.Timestamp from)
-
toM3DurationSinceNow
public static com.uber.m3.util.Duration toM3DurationSinceNow(com.google.protobuf.Timestamp t)
-
toJavaInstant
@Nullable public static java.time.Instant toJavaInstant(@Nullable com.google.protobuf.Timestamp t)
-
toProtoTimestamp
@Nullable public static com.google.protobuf.Timestamp toProtoTimestamp(@Nullable java.time.Instant t)
-
-