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.Builder
withRate
in interface TokenBucket.Builder
r
- a rate valuepublic TokenBucket.Builder withBurstSize(long bS)
TokenBucket.Builder
withBurstSize
in interface TokenBucket.Builder
bS
- a burst sizepublic TokenBucket.Builder withAction(TokenBucket.Action a)
TokenBucket.Builder
Note: mandatory setter for this builder
withAction
in interface TokenBucket.Builder
a
- an actionpublic TokenBucket.Builder withDscp(short d)
TokenBucket.Builder
withDscp
in interface TokenBucket.Builder
d
- a dscp valuepublic TokenBucket.Builder withType(TokenBucket.Type t)
TokenBucket.Builder
Note: mandatory setter for this builder
withType
in interface TokenBucket.Builder
t
- the typepublic DefaultTokenBucket build()
TokenBucket.Builder
build
in interface TokenBucket.Builder