Package org.microproxy.contentviews
Record Class ProtoMessage
java.lang.Object
java.lang.Record
org.microproxy.contentviews.ProtoMessage
- Record Components:
fields- the fields, in wire ordertype- the schema type the message was decoded as, ornullwithout a schema
A decoded protobuf message: its fields in the order they appeared on the wire. Build one by
hand to encode it (
Protobuf.encode(ProtoMessage)), or get one from Protobuf.decode(byte[]).-
Constructor Summary
ConstructorsConstructorDescriptionProtoMessage(List<ProtoField> fields) A message without a schema type.ProtoMessage(List<ProtoField> fields, ProtoSchema.MessageType type) Copies the field list. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.fields()Returns the value of thefieldsrecord component.first(int number) The first value of fieldnumber.final inthashCode()Returns a hash code value for this object.render()The message as readable YAML-like text with field numbers (or declared names), asProtobuf.render(byte[])shows it.toPlain()The message as plain Java values, as scripts see it: seeProtobuf.toPlain(org.microproxy.contentviews.ProtoMessage).toString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.values(int number) The values of fieldnumber, in wire order (the elements of a packed field count one by one).
-
Constructor Details
-
ProtoMessage
Copies the field list.- Parameters:
fields- the fields, in wire ordertype- the schema type, ornull
-
ProtoMessage
A message without a schema type.- Parameters:
fields- the fields, in wire order
-
-
Method Details
-
values
The values of fieldnumber, in wire order (the elements of a packed field count one by one).- Parameters:
number- the field number- Returns:
- the values, possibly none
-
first
The first value of fieldnumber.- Parameters:
number- the field number- Returns:
- the value, or empty when the field is absent
-
toPlain
The message as plain Java values, as scripts see it: seeProtobuf.toPlain(org.microproxy.contentviews.ProtoMessage).- Returns:
- a mutable map from field numbers (or declared names) to values
-
render
The message as readable YAML-like text with field numbers (or declared names), asProtobuf.render(byte[])shows it.- Returns:
- the text
-
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). -
fields
Returns the value of thefieldsrecord component.- Returns:
- the value of the
fieldsrecord component
-
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-