Package org.onosproject.net.meter
Class DefaultMeter.Builder
- java.lang.Object
-
- org.onosproject.net.meter.DefaultMeter.Builder
-
- All Implemented Interfaces:
Meter.Builder
- Enclosing class:
- DefaultMeter
public static final class DefaultMeter.Builder extends java.lang.Object implements Meter.Builder
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DefaultMeterbuild()Builds the meter based on the specified parameters.Meter.Builderburst()Sets this meter as applicable to burst traffic only.Meter.BuilderforDevice(DeviceId deviceId)Assigns the target device for this meter.Meter.BuilderfromApp(ApplicationId appId)Assigns the application that built this meter.Meter.BuilderwithBands(java.util.Collection<Band> bands)Assigns bands to this meter.Meter.BuilderwithCellId(MeterCellId cellId)Assigns the id to this meter cell.Meter.BuilderwithId(MeterId id)Assigns the id to this meter.Meter.BuilderwithUnit(Meter.Unit unit)Assigns the @See Unit to use for this meter.
-
-
-
Method Detail
-
forDevice
public Meter.Builder forDevice(DeviceId deviceId)
Description copied from interface:Meter.BuilderAssigns the target device for this meter.- Specified by:
forDevicein interfaceMeter.Builder- Parameters:
deviceId- a device id- Returns:
- this
-
withId
public Meter.Builder withId(MeterId id)
Description copied from interface:Meter.BuilderAssigns the id to this meter.- Specified by:
withIdin interfaceMeter.Builder- Parameters:
id- a e- Returns:
- this
-
withCellId
public Meter.Builder withCellId(MeterCellId cellId)
Description copied from interface:Meter.BuilderAssigns the id to this meter cell.- Specified by:
withCellIdin interfaceMeter.Builder- Parameters:
cellId- a meter cell identifier- Returns:
- this
-
fromApp
public Meter.Builder fromApp(ApplicationId appId)
Description copied from interface:Meter.BuilderAssigns the application that built this meter.- Specified by:
fromAppin interfaceMeter.Builder- Parameters:
appId- an application id- Returns:
- this
-
withUnit
public Meter.Builder withUnit(Meter.Unit unit)
Description copied from interface:Meter.BuilderAssigns the @See Unit to use for this meter. Defaults to kb/s- Specified by:
withUnitin interfaceMeter.Builder- Parameters:
unit- a unit- Returns:
- this
-
burst
public Meter.Builder burst()
Description copied from interface:Meter.BuilderSets this meter as applicable to burst traffic only. Defaults to false.- Specified by:
burstin interfaceMeter.Builder- Returns:
- this
-
withBands
public Meter.Builder withBands(java.util.Collection<Band> bands)
Description copied from interface:Meter.BuilderAssigns bands to this meter. There must be at least one band.- Specified by:
withBandsin interfaceMeter.Builder- Parameters:
bands- a collection of bands- Returns:
- this
-
build
public DefaultMeter build()
Description copied from interface:Meter.BuilderBuilds the meter based on the specified parameters.- Specified by:
buildin interfaceMeter.Builder- Returns:
- a meter
-
-