Package org.onosproject.net.pi.runtime
Class PiCounterCellId
- java.lang.Object
-
- org.onosproject.net.pi.runtime.PiCounterCellId
-
@Beta public final class PiCounterCellId extends Object
Identifier of a counter cell in a protocol-independent pipeline.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description PiCounterId
counterId()
Returns the identifier of the counter instance where this cell is contained.PiCounterType
counterType()
Returns the type of the counter identified.boolean
equals(Object obj)
int
hashCode()
long
index()
Returns the counter index to which this cell ID is associated.static PiCounterCellId
ofDirect(PiTableEntry tableEntry)
Return a direct counter cell ID for the given counter ID and table entry.static PiCounterCellId
ofIndirect(PiCounterId counterId, long index)
Return an indirect counter cell ID for the given counter ID and index.PiTableEntry
tableEntry()
Returns the table entry to which this cell ID is associated.String
toString()
-
-
-
Method Detail
-
counterId
public PiCounterId counterId()
Returns the identifier of the counter instance where this cell is contained. Meaningful only if the counter is of typePiCounterType.INDIRECT
.- Returns:
- counter identifier
-
counterType
public PiCounterType counterType()
Returns the type of the counter identified.- Returns:
- counter type
-
index
public long index()
Returns the counter index to which this cell ID is associated. Meaningful only if the counter is of typePiCounterType.INDIRECT
.- Returns:
- counter index
-
tableEntry
public PiTableEntry tableEntry()
Returns the table entry to which this cell ID is associated. Meaningful only if the counter is of typePiCounterType.DIRECT
, otherwise returns null.- Returns:
- PI table entry or null
-
ofDirect
public static PiCounterCellId ofDirect(PiTableEntry tableEntry)
Return a direct counter cell ID for the given counter ID and table entry.- Parameters:
tableEntry
- table entry- Returns:
- counter cell ID
-
ofIndirect
public static PiCounterCellId ofIndirect(PiCounterId counterId, long index)
Return an indirect counter cell ID for the given counter ID and index.- Parameters:
counterId
- counter IDindex
- index- Returns:
- counter cell ID
-
-