Class TimeInterval


  • public class TimeInterval
    extends java.lang.Object
    Class that describes a time unit for use within the adapter.
    See Also:
    TimeUnit

    In the adapter configuration file this class is aliased as time-interval which is the preferred alternative to the fully qualified classname when building your configuration.

    • Constructor Detail

      • TimeInterval

        public TimeInterval()
      • TimeInterval

        public TimeInterval​(java.lang.Long interval,
                            java.lang.String unit)
      • TimeInterval

        public TimeInterval​(java.lang.Long interval,
                            java.util.concurrent.TimeUnit unit)
    • Method Detail

      • toMilliseconds

        public long toMilliseconds()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getUnit

        public java.util.concurrent.TimeUnit getUnit()
      • setUnit

        public void setUnit​(java.util.concurrent.TimeUnit unit)
        Define the unit for this interval.
        Parameters:
        unit - the unit, if not specified (or unknown) defaults to TimeUnit.SECONDS
      • getInterval

        public java.lang.Long getInterval()
      • setInterval

        public void setInterval​(java.lang.Long interval)
        Define the actual interval for this interval.
        Parameters:
        interval - the interval, if not specified defaults to 10.
      • toMillisecondsDefaultIfNull

        public static long toMillisecondsDefaultIfNull​(TimeInterval t,
                                                       long defaultMs)
      • toMillisecondsDefaultIfNull

        public static long toMillisecondsDefaultIfNull​(TimeInterval t,
                                                       TimeInterval defaultInterval)
      • toSecondsDefaultIfNull

        public static long toSecondsDefaultIfNull​(TimeInterval t,
                                                  long defaultMs)