Class OptionsUtils


  • public final class OptionsUtils
    extends java.lang.Object
    • 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • DEFAULT_TASK_START_TO_CLOSE_TIMEOUT

        public static final java.time.Duration DEFAULT_TASK_START_TO_CLOSE_TIMEOUT
    • 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.