Package org.onosproject.net.pi.runtime
Class PiMeterCellId
- java.lang.Object
-
- org.onosproject.net.pi.runtime.PiMeterCellId
-
- All Implemented Interfaces:
MeterCellId
@Beta public final class PiMeterCellId extends Object implements MeterCellId
Identifier of a meter cell in a protocol-independent pipeline.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.onosproject.net.meter.MeterCellId
MeterCellId.MeterCellType
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
int
hashCode()
long
index()
Returns the meter index to which this cell ID is associated.PiMeterId
meterId()
Returns the identifier of the meter instance where this cell is contained.PiMeterType
meterType()
Returns the type of the meter identified.static PiMeterCellId
ofDirect(PiTableEntry tableEntry)
Return a direct meter cell ID for the given meter ID and table entry.static PiMeterCellId
ofIndirect(PiMeterId meterId, long index)
Return an indirect meter cell ID for the given meter ID and index.PiTableEntry
tableEntry()
Returns the table entry to which this cell ID is associated.String
toString()
MeterCellId.MeterCellType
type()
Return the type of this meter cell identifier.
-
-
-
Method Detail
-
meterId
public PiMeterId meterId()
Returns the identifier of the meter instance where this cell is contained. Meaningful only if the meter is of typePiMeterType.DIRECT
, otherwise returns null.- Returns:
- meter identifier
-
meterType
public PiMeterType meterType()
Returns the type of the meter identified.- Returns:
- meter type
-
index
public long index()
Returns the meter index to which this cell ID is associated. Meaningful only if the meter is of typePiMeterType.INDIRECT
.- Returns:
- meter index
-
tableEntry
public PiTableEntry tableEntry()
Returns the table entry to which this cell ID is associated. Meaningful only if the meter is of typePiMeterType.DIRECT
, otherwise returns null.- Returns:
- PI table entry or null
-
type
public MeterCellId.MeterCellType type()
Description copied from interface:MeterCellId
Return the type of this meter cell identifier.- Specified by:
type
in interfaceMeterCellId
- Returns:
- type
-
ofDirect
public static PiMeterCellId ofDirect(PiTableEntry tableEntry)
Return a direct meter cell ID for the given meter ID and table entry.- Parameters:
tableEntry
- table entry- Returns:
- meter cell ID
-
ofIndirect
public static PiMeterCellId ofIndirect(PiMeterId meterId, long index)
Return an indirect meter cell ID for the given meter ID and index.- Parameters:
meterId
- meter IDindex
- index- Returns:
- meter cell ID
-
-