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 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)  
      • 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
      • 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.