TimedSemaphore.Builder (Apache Commons Lang 3.20.0 API)
Description: declaration: package: org.apache.commons.lang3.concurrent, class: TimedSemaphore, class: Builder

# Class TimedSemaphore.Builder

java.lang.Object
org.apache.commons.lang3.concurrent.TimedSemaphore.Builder

All Implemented Interfaces:
  `Supplier<TimedSemaphore>`

Enclosing class:
  `TimedSemaphore`

public static class TimedSemaphore.Builder extends Object implements Supplier<TimedSemaphore>
Builds new `TimedSemaphore`.

Since:
  3.20.0

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Builder()`
  Constructs a new Builder.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `TimedSemaphore`
  `get()`
  `TimedSemaphore.Builder`
  `setLimit(int limit)`
  Sets the limit.
  `TimedSemaphore.Builder`
  `setPeriod(long period)`
  Sets the time period.
  `TimedSemaphore.Builder`
  `setService(ScheduledExecutorService service)`
  Sets the executor service.
  `TimedSemaphore.Builder`
  `setTimeUnit(TimeUnit timeUnit)`
  Sets the time unit for the period.

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### Builder

    public Builder()
    Constructs a new Builder.

- ## Method Details

  - ### get

    public TimedSemaphore get()
    Specified by:
      `get` in interface `Supplier<TimedSemaphore>`

  - ### setLimit

    public TimedSemaphore.Builder setLimit(int limit)
    Sets the limit.
    Parameters:
      `limit` - The limit.
    Returns:
      `this` instance.

  - ### setPeriod

    public TimedSemaphore.Builder setPeriod(long period)
    Sets the time period.
    Parameters:
      `period` - The time period.
    Returns:
      `this` instance.

  - ### setService

    public TimedSemaphore.Builder setService(ScheduledExecutorService service)
    Sets the executor service.
    Parameters:
      `service` - The executor service.
    Returns:
      `this` instance.

  - ### setTimeUnit

    public TimedSemaphore.Builder setTimeUnit(TimeUnit timeUnit)
    Sets the time unit for the period.
    Parameters:
      `timeUnit` - The time unit for the period.
    Returns:
      `this` instance.