Package com.uber.cadence.internal.common
Class OptionsUtils
- java.lang.Object
-
- com.uber.cadence.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 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 annotation, G options, java.lang.Class<G> type)
Merges value from annotation and option.static java.time.Duration
roundUpToSeconds(java.time.Duration duration)
Round durations to seconds rounding up.static java.time.Duration
roundUpToSeconds(java.time.Duration duration, java.time.Duration defaultValue)
Convert milliseconds to seconds rounding up.
-
-
-
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
-
-
Method Detail
-
merge
public static <G> G merge(G annotation, G options, java.lang.Class<G> type)
Merges value from annotation and option. Option value takes precedence.
-
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.
-
roundUpToSeconds
public static java.time.Duration 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 java.time.Duration 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.
-
-