Package io.github.zhh2001.jp4.pipeline
Record Class MatchFieldInfo
java.lang.Object
java.lang.Record
io.github.zhh2001.jp4.pipeline.MatchFieldInfo
- Record Components:
id- P4Runtime numeric id (1-based, unique within the owning table)name- fully-qualified field name as written in the P4 program, e.g."hdr.ipv4.dstAddr"matchKind- one ofMatchFieldInfo.Kind.EXACT,MatchFieldInfo.Kind.LPM,MatchFieldInfo.Kind.TERNARY,MatchFieldInfo.Kind.RANGE,MatchFieldInfo.Kind.OPTIONAL, orMatchFieldInfo.Kind.UNSPECIFIEDbitWidth- width of the field as declared in the P4 program (e.g. 32 for IPv4, 48 for MAC)
public record MatchFieldInfo(int id, String name, MatchFieldInfo.Kind matchKind, int bitWidth)
extends Record
Read-only metadata for one match field of a
TableInfo, derived from P4Info.- Since:
- 0.1.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumMirrors P4Runtime'sMatchField.MatchTypeenum at the public-API layer so callers don't depend on generated protobuf types. -
Constructor Summary
ConstructorsConstructorDescriptionMatchFieldInfo(int id, String name, MatchFieldInfo.Kind matchKind, int bitWidth) Creates an instance of aMatchFieldInforecord class. -
Method Summary
Modifier and TypeMethodDescriptionintbitWidth()Returns the value of thebitWidthrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intid()Returns the value of theidrecord component.Returns the value of thematchKindrecord component.name()Returns the value of thenamerecord component.final StringtoString()Returns a string representation of this record class.
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
id
public int id()Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
matchKind
Returns the value of thematchKindrecord component.- Returns:
- the value of the
matchKindrecord component
-
bitWidth
public int bitWidth()Returns the value of thebitWidthrecord component.- Returns:
- the value of the
bitWidthrecord component
-