Package io.github.zhh2001.jp4.entity
Record Class MeterCounterData
java.lang.Object
java.lang.Record
io.github.zhh2001.jp4.entity.MeterCounterData
- Record Components:
green- cumulative counter for green-marked packetsyellow- cumulative counter for yellow-marked packetsred- cumulative counter for red-marked packets
public record MeterCounterData(CounterData green, CounterData yellow, CounterData red)
extends Record
Per-color cumulative packet and byte counters for one P4 meter cell.
The three slots correspond to the green / yellow / red traffic-color
marking defined by RFC 2697 (srTCM) and RFC 2698 (trTCM): a packet
conforming to both the CIR and the CBurst is marked green, a packet
exceeding the CIR but conforming to the PIR (trTCM) or the EBS (srTCM)
is marked yellow, and a packet exceeding the PIR or the EBS is marked
red.
The MeterCounterData message was added in P4Runtime
v1.4.0; devices on older spec versions may return zero counters across
the board. Each color slot is non-null — the record stores zero
counters explicitly rather than null.
- Since:
- 1.4.0
-
Constructor Summary
ConstructorsConstructorDescriptionMeterCounterData(CounterData green, CounterData yellow, CounterData red) Creates an instance of aMeterCounterDatarecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.green()Returns the value of thegreenrecord component.final inthashCode()Returns a hash code value for this object.red()Returns the value of theredrecord component.final StringtoString()Returns a string representation of this record class.yellow()Returns the value of theyellowrecord component.
-
Constructor Details
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
green
Returns the value of thegreenrecord component.- Returns:
- the value of the
greenrecord component
-
yellow
Returns the value of theyellowrecord component.- Returns:
- the value of the
yellowrecord component
-
red
Returns the value of theredrecord component.- Returns:
- the value of the
redrecord component
-