Class SchedulerUtils


  • public class SchedulerUtils
    extends Object
    Utilities class for scheduler extensions.
    • Method Detail

      • parseDelayedAsMillis

        public static long parseDelayedAsMillis​(Scheduled scheduled)
        Parse the `@Scheduled(delayed = "")` field into milliseconds.
        Parameters:
        scheduled - annotation
        Returns:
        returns the duration in milliseconds.
      • parseEveryAsMillis

        public static OptionalLong parseEveryAsMillis​(Scheduled scheduled)
        Parse the `@Scheduled(every = "")` field into milliseconds.
        Parameters:
        scheduled - annotation
        Returns:
        returns the duration in milliseconds or OptionalLong.empty() if the expression evaluates to "off" or "disabled".
      • isOff

        public static boolean isOff​(String value)
      • lookUpPropertyValue

        public static String lookUpPropertyValue​(String propertyValue)
        Looks up the property value by checking whether the value is a configuration key and resolves it if so.
        Parameters:
        propertyValue - property value to look up.
        Returns:
        the resolved property value.
      • isConfigValue

        public static boolean isConfigValue​(String val)