public class ConfigurationBuilder<T extends ConfigurationBuilder> extends Object
Modifier | Constructor and Description |
---|---|
protected |
ConfigurationBuilder() |
Modifier and Type | Method and Description |
---|---|
T |
addLimit(Bandwidth bandwidth)
Adds limited bandwidth for all buckets which will be constructed by this builder instance.
|
T |
addLimit(long initialTokens,
Bandwidth bandwidth)
Adds limited bandwidth for all buckets which will be constructed by this builder instance.
|
BucketConfiguration |
buildConfiguration() |
String |
toString() |
T |
withCustomTimePrecision(TimeMeter customTimeMeter)
Creates instance of
ConfigurationBuilder which will create buckets with customTimeMeter as time meter. |
T |
withMillisecondPrecision()
Creates instance of
ConfigurationBuilder which will create buckets with TimeMeter.SYSTEM_MILLISECONDS as time meter. |
T |
withNanosecondPrecision()
Creates instance of
ConfigurationBuilder which will create buckets with TimeMeter.SYSTEM_NANOTIME as time meter. |
public BucketConfiguration buildConfiguration()
public T addLimit(Bandwidth bandwidth)
bandwidth
- limitationpublic T addLimit(long initialTokens, Bandwidth bandwidth)
bandwidth
- limitationinitialTokens
- the count of initial tokenspublic T withNanosecondPrecision()
ConfigurationBuilder
which will create buckets with TimeMeter.SYSTEM_NANOTIME
as time meter.public T withMillisecondPrecision()
ConfigurationBuilder
which will create buckets with TimeMeter.SYSTEM_MILLISECONDS
as time meter.public T withCustomTimePrecision(TimeMeter customTimeMeter)
ConfigurationBuilder
which will create buckets with customTimeMeter
as time meter.customTimeMeter
- object which will measure time.Copyright © 2017. All rights reserved.