public static final class DefaultTokenBucket.Builder extends Object implements TokenBucket.Builder
| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
DefaultTokenBucket |
build()
Builds the token bucket based on the specified
parameters when possible.
|
TokenBucket.Builder |
withAction(TokenBucket.Action a)
Assigns the action to this token bucket.
|
TokenBucket.Builder |
withBurstSize(long bS)
Assigns the burst size to this token bucket.
|
TokenBucket.Builder |
withDscp(short d)
Assigns the dscp value to this token bucket.
|
TokenBucket.Builder |
withRate(long r)
Assigns the rate to this token bucket.
|
TokenBucket.Builder |
withType(TokenBucket.Type t)
Assigns the type to this token bucket.
|
public TokenBucket.Builder withRate(long r)
TokenBucket.BuilderwithRate in interface TokenBucket.Builderr - a rate valuepublic TokenBucket.Builder withBurstSize(long bS)
TokenBucket.BuilderwithBurstSize in interface TokenBucket.BuilderbS - a burst sizepublic TokenBucket.Builder withAction(TokenBucket.Action a)
TokenBucket.BuilderNote: mandatory setter for this builder
withAction in interface TokenBucket.Buildera - an actionpublic TokenBucket.Builder withDscp(short d)
TokenBucket.BuilderwithDscp in interface TokenBucket.Builderd - a dscp valuepublic TokenBucket.Builder withType(TokenBucket.Type t)
TokenBucket.BuilderNote: mandatory setter for this builder
withType in interface TokenBucket.Buildert - the typepublic DefaultTokenBucket build()
TokenBucket.Builderbuild in interface TokenBucket.Builder