Class RateLimiter.SimpleBuilder

  • Enclosing interface:
    RateLimiter

    public static class RateLimiter.SimpleBuilder
    extends java.lang.Object
    Used for building instances of RateLimiter that respect a minimal spacing between tasks.
    See Also:
    RateLimiter.simpleBuilder()
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      RateLimiter build()
      Builds the RateLimiter instance.
      RateLimiter.SimpleBuilder limit​(java.lang.Long limit)
      Sets the minimal spacing between execution of tasks in ms.
      • Methods inherited from class java.lang.Object

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

      • limit

        @Nonnull
        public RateLimiter.SimpleBuilder limit​(@Nonnegative @Nullable
                                               java.lang.Long limit)
        Sets the minimal spacing between execution of tasks in ms.
        Parameters:
        limit - the minimal spacing between execution of tasks in ms or null
        Returns:
        itself for chaining
      • build

        @Nonnull
        public RateLimiter build()
        Builds the RateLimiter instance.
        Returns:
        the RateLimiter instance