Record Class ProtoSchema.Field

java.lang.Object
java.lang.Record
org.microproxy.contentviews.ProtoSchema.Field
Record Components:
name - the field's name
number - the field number
type - the declared type
repeated - whether the field is repeated (or a map)
typeName - the full name of the message or enum type (without a leading dot) for ProtoSchema.Type.MESSAGE, ProtoSchema.Type.GROUP and ProtoSchema.Type.ENUM; otherwise null
packed - whether repeated values are encoded packed
Enclosing class:
ProtoSchema

public static record ProtoSchema.Field(String name, int number, ProtoSchema.Type type, boolean repeated, String typeName, boolean packed) extends Record
A field of a message type.
  • Constructor Details

    • Field

      public Field(String name, int number, ProtoSchema.Type type, boolean repeated, String typeName, boolean packed)
      Checks the field.
      Parameters:
      name - the field's name
      number - the field number
      type - the declared type
      repeated - whether the field is repeated
      typeName - the referenced type's full name, or null
      packed - whether repeated values are packed
  • Method Details

    • 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.
    • name

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

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

      public ProtoSchema.Type type()
      Returns the value of the type record component.
      Returns:
      the value of the type record component
    • repeated

      public boolean repeated()
      Returns the value of the repeated record component.
      Returns:
      the value of the repeated record component
    • typeName

      public String typeName()
      Returns the value of the typeName record component.
      Returns:
      the value of the typeName record component
    • packed

      public boolean packed()
      Returns the value of the packed record component.
      Returns:
      the value of the packed record component