public static final class DefaultPolicer.Builder extends java.lang.Object implements Policer.Builder
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
DefaultPolicer |
build()
Builds the policer based on the specified parameters
when possible.
|
Policer.Builder |
colorAware(boolean isColorAware)
Sets this policer to be color aware.
|
Policer.Builder |
forDeviceId(DeviceId dId)
Assigns the device for this policer.
|
Policer.Builder |
fromApp(ApplicationId appId)
Assigns the application that built this policer.
|
Policer.Builder |
withDescription(java.lang.String d)
Assigns description for this policer.
|
Policer.Builder |
withId(PolicerId id)
Assigns the id to this policer.
|
Policer.Builder |
withPolicingResource(PolicingResource policingResource)
Assigns policer id and device id for this policer.
|
Policer.Builder |
withTokenBuckets(java.util.Collection<TokenBucket> tB)
Assigns token buckets for this policer.
|
Policer.Builder |
withUnit(Policer.Unit u)
Assigns the unit to use for this policer.
|
public Policer.Builder forDeviceId(DeviceId dId)
Policer.Builder
Note: mandatory setter for this builder
forDeviceId
in interface Policer.Builder
dId
- a device idpublic Policer.Builder fromApp(ApplicationId appId)
Policer.Builder
Note: mandatory setter for this builder
fromApp
in interface Policer.Builder
appId
- an application idpublic Policer.Builder withId(PolicerId id)
Policer.Builder
Note: mandatory setter for this builder
withId
in interface Policer.Builder
id
- an identifierpublic Policer.Builder colorAware(boolean isColorAware)
Policer.Builder
colorAware
in interface Policer.Builder
isColorAware
- if it is color aware or notpublic Policer.Builder withUnit(Policer.Unit u)
Policer.Builder
withUnit
in interface Policer.Builder
u
- a unitpublic Policer.Builder withPolicingResource(PolicingResource policingResource)
Policer.Builder
withPolicingResource
in interface Policer.Builder
policingResource
- the policing resourcepublic Policer.Builder withTokenBuckets(java.util.Collection<TokenBucket> tB)
Policer.Builder
Note: at least one token bucket
withTokenBuckets
in interface Policer.Builder
tB
- the collection of token bucketspublic Policer.Builder withDescription(java.lang.String d)
Policer.Builder
withDescription
in interface Policer.Builder
d
- the descriptionpublic DefaultPolicer build()
Policer.Builder
build
in interface Policer.Builder