Class TimedSemaphore.Builder
java.lang.Object
org.apache.commons.lang3.concurrent.TimedSemaphore.Builder
- All Implemented Interfaces:
Supplier<TimedSemaphore>
- Enclosing class:
TimedSemaphore
Builds new
TimedSemaphore.- Since:
- 3.20.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionget()setLimit(int limit) Sets the limit.setPeriod(long period) Sets the time period.setService(ScheduledExecutorService service) Sets the executor service.setTimeUnit(TimeUnit timeUnit) Sets the time unit for the period.
-
Constructor Details
-
Builder
public Builder()Constructs a new Builder.
-
-
Method Details
-
get
- Specified by:
getin interfaceSupplier<TimedSemaphore>
-
setLimit
Sets the limit.- Parameters:
limit- The limit.- Returns:
thisinstance.
-
setPeriod
Sets the time period.- Parameters:
period- The time period.- Returns:
thisinstance.
-
setService
Sets the executor service.- Parameters:
service- The executor service.- Returns:
thisinstance.
-
setTimeUnit
Sets the time unit for the period.- Parameters:
timeUnit- The time unit for the period.- Returns:
thisinstance.
-