public static final class DefaultPolicer.Builder extends 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(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(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.BuilderNote: mandatory setter for this builder
forDeviceId in interface Policer.BuilderdId - a device idpublic Policer.Builder fromApp(ApplicationId appId)
Policer.BuilderNote: mandatory setter for this builder
fromApp in interface Policer.BuilderappId - an application idpublic Policer.Builder withId(PolicerId id)
Policer.BuilderNote: mandatory setter for this builder
withId in interface Policer.Builderid - an identifierpublic Policer.Builder colorAware(boolean isColorAware)
Policer.BuildercolorAware in interface Policer.BuilderisColorAware - if it is color aware or notpublic Policer.Builder withUnit(Policer.Unit u)
Policer.BuilderwithUnit in interface Policer.Builderu - a unitpublic Policer.Builder withPolicingResource(PolicingResource policingResource)
Policer.BuilderwithPolicingResource in interface Policer.BuilderpolicingResource - the policing resourcepublic Policer.Builder withTokenBuckets(Collection<TokenBucket> tB)
Policer.BuilderNote: at least one token bucket
withTokenBuckets in interface Policer.BuildertB - the collection of token bucketspublic Policer.Builder withDescription(String d)
Policer.BuilderwithDescription in interface Policer.Builderd - the descriptionpublic DefaultPolicer build()
Policer.Builderbuild in interface Policer.Builder