Record Class ProtoField

java.lang.Object
java.lang.Record
org.microproxy.contentviews.ProtoField
Record Components:
number - the field number (1 to 229-1)
value - the value
declared - the field's declaration in the schema the message was decoded with, or null for a field the schema does not know (or that did not match its declared type) and for messages decoded without a schema

public record ProtoField(int number, ProtoValue value, ProtoSchema.Field declared) extends Record
One field of a decoded protobuf message, as it appeared on the wire. A repeated field that was not packed appears once per value.
  • Constructor Details

    • ProtoField

      public ProtoField(int number, ProtoValue value, ProtoSchema.Field declared)
      Checks the field number and value.
      Parameters:
      number - the field number (1 to 229-1)
      value - the value
      declared - the field's declaration, or null
      Throws:
      IllegalArgumentException - if the field number is out of range
    • ProtoField

      public ProtoField(int number, ProtoValue value)
      A field without a declaration.
      Parameters:
      number - the field number (1 to 229-1)
      value - the value
  • Method Details

    • name

      public String name()
      Returns the declared name of the field, or null without a declaration.
      Returns:
      the declared name of the field, or null without a declaration
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • number

      public int number()
      Returns the value of the number record component.
      Returns:
      the value of the number record component
    • value

      public ProtoValue value()
      Returns the value of the value record component.
      Returns:
      the value of the value record component
    • declared

      public ProtoSchema.Field declared()
      Returns the value of the declared record component.
      Returns:
      the value of the declared record component