Class ThrottlingRate


  • public final class ThrottlingRate
    extends Object
    A value object to represent a throttling rate.
    • Constructor Detail

      • ThrottlingRate

        public ThrottlingRate​(int numberOfRequests,
                              String duration)
        Constructs a new ThrottlingRate.
        Parameters:
        numberOfRequests - the maximum of requests that can be filtered out during the duration.
        duration - the string representing the duration of the sliding window.
    • Method Detail

      • getNumberOfRequests

        public int getNumberOfRequests()
        Returns the maximum of requests that can be filtered out during the duration.
        Returns:
        the maximum of requests that can be filtered out during the duration
      • getDuration

        public Duration getDuration()
        Returns the duration of the sliding window.
        Returns:
        the duration of the sliding window
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object