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 java.lang.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 booleanequals(java.lang.Object obj)inthashCode()longindex()Returns the meter index to which this cell ID is associated.PiMeterIdmeterId()Returns the identifier of the meter instance where this cell is contained.PiMeterTypemeterType()Returns the type of the meter identified.static PiMeterCellIdofDirect(PiTableEntry tableEntry)Return a direct meter cell ID for the given meter ID and table entry.static PiMeterCellIdofIndirect(PiMeterId meterId, long index)Return an indirect meter cell ID for the given meter ID and index.PiTableEntrytableEntry()Returns the table entry to which this cell ID is associated.java.lang.StringtoString()MeterCellId.MeterCellTypetype()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:MeterCellIdReturn the type of this meter cell identifier.- Specified by:
typein 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
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-