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 DefaultMeter
build()
Builds the meter based on the specified parameters.Meter.Builder
burst()
Sets this meter as applicable to burst traffic only.Meter.Builder
forDevice(DeviceId deviceId)
Assigns the target device for this meter.Meter.Builder
fromApp(ApplicationId appId)
Assigns the application that built this meter.Meter.Builder
withBands(java.util.Collection<Band> bands)
Assigns bands to this meter.Meter.Builder
withCellId(MeterCellId cellId)
Assigns the id to this meter cell.Meter.Builder
withId(MeterId id)
Assigns the id to this meter.Meter.Builder
withUnit(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.Builder
Assigns the target device for this meter.- Specified by:
forDevice
in interfaceMeter.Builder
- Parameters:
deviceId
- a device id- Returns:
- this
-
withId
public Meter.Builder withId(MeterId id)
Description copied from interface:Meter.Builder
Assigns the id to this meter.- Specified by:
withId
in interfaceMeter.Builder
- Parameters:
id
- a e- Returns:
- this
-
withCellId
public Meter.Builder withCellId(MeterCellId cellId)
Description copied from interface:Meter.Builder
Assigns the id to this meter cell.- Specified by:
withCellId
in interfaceMeter.Builder
- Parameters:
cellId
- a meter cell identifier- Returns:
- this
-
fromApp
public Meter.Builder fromApp(ApplicationId appId)
Description copied from interface:Meter.Builder
Assigns the application that built this meter.- Specified by:
fromApp
in interfaceMeter.Builder
- Parameters:
appId
- an application id- Returns:
- this
-
withUnit
public Meter.Builder withUnit(Meter.Unit unit)
Description copied from interface:Meter.Builder
Assigns the @See Unit to use for this meter. Defaults to kb/s- Specified by:
withUnit
in interfaceMeter.Builder
- Parameters:
unit
- a unit- Returns:
- this
-
burst
public Meter.Builder burst()
Description copied from interface:Meter.Builder
Sets this meter as applicable to burst traffic only. Defaults to false.- Specified by:
burst
in interfaceMeter.Builder
- Returns:
- this
-
withBands
public Meter.Builder withBands(java.util.Collection<Band> bands)
Description copied from interface:Meter.Builder
Assigns bands to this meter. There must be at least one band.- Specified by:
withBands
in interfaceMeter.Builder
- Parameters:
bands
- a collection of bands- Returns:
- this
-
build
public DefaultMeter build()
Description copied from interface:Meter.Builder
Builds the meter based on the specified parameters.- Specified by:
build
in interfaceMeter.Builder
- Returns:
- a meter
-
-