Package io.temporal.internal.common
Class OptionsUtils
- java.lang.Object
-
- io.temporal.internal.common.OptionsUtils
-
public final class OptionsUtils extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static java.time.Duration
DEFAULT_TASK_START_TO_CLOSE_TIMEOUT
static byte[]
EMPTY_BLOB
static float
SECOND
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.time.Duration
merge(long aSeconds, java.time.Duration o)
Merges value from annotation in seconds with option value as Duration.static <G> G
merge(G value, G overrideValueIfNotDefault, java.lang.Class<G> type)
static java.lang.String[]
merge(java.lang.String[] fromAnnotation, java.lang.String[] fromOptions)
static int
roundUpToSeconds(java.time.Duration duration)
Round durations to seconds rounding up.static int
roundUpToSeconds(java.time.Duration duration, java.time.Duration defaultValue)
Convert milliseconds to seconds rounding up.static byte[]
safeGet(byte[] value)
static java.lang.String
safeGet(java.lang.String value)
static com.google.protobuf.ByteString
toByteString(byte[] value)
-
-
-
Field Detail
-
DEFAULT_TASK_START_TO_CLOSE_TIMEOUT
public static final java.time.Duration DEFAULT_TASK_START_TO_CLOSE_TIMEOUT
-
SECOND
public static final float SECOND
- See Also:
- Constant Field Values
-
EMPTY_BLOB
public static final byte[] EMPTY_BLOB
-
-
Method Detail
-
toByteString
public static com.google.protobuf.ByteString toByteString(byte[] value)
-
safeGet
public static byte[] safeGet(byte[] value)
-
safeGet
public static java.lang.String safeGet(java.lang.String value)
-
merge
public static <G> G merge(G value, G overrideValueIfNotDefault, java.lang.Class<G> type)
-
merge
public static java.time.Duration merge(long aSeconds, java.time.Duration o)
Merges value from annotation in seconds with option value as Duration. Option value takes precedence.
-
merge
public static java.lang.String[] merge(java.lang.String[] fromAnnotation, java.lang.String[] fromOptions)
-
roundUpToSeconds
public static int roundUpToSeconds(java.time.Duration duration, java.time.Duration defaultValue)
Convert milliseconds to seconds rounding up. Used by timers to ensure that they never fire earlier than requested.
-
roundUpToSeconds
public static int roundUpToSeconds(java.time.Duration duration)
Round durations to seconds rounding up. As all timeouts and timers resolution is in seconds ensures that nothing times out or fires before the requested time.
-
-