Record Class Message
java.lang.Object
java.lang.Record
lol.trq.orpheus.linux.dbus.Message
- Record Components:
type-CALL,RETURN,ERRORorSIGNALserial- the sender's serial number; assigned on sendingreplySerial- the serial this message answers, or 0path- the object pathiface- the interfacemember- the method or signal nameerror- the error name of an error replydestination- the bus name the message goes tosender- the unique bus name it came fromsignature- the body signature, empty for no bodybody- the body values, one per complete type
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic longannounced(byte[] header) The number of bytes after the fixed header, whatever its size; for skipping a message that is too large.body()Returns the value of thebodyrecord component.static Messagecall(String destination, String path, String iface, String member, String signature, Object... body) static Messagedecode(byte[] data) Decodes a complete message: the fixed header followed by everythingremaining(byte[])announced.Returns the value of thedestinationrecord component.byte[]encode(long withSerial) final booleanIndicates whether some other object is "equal to" this one.error()Returns the value of theerrorrecord component.errorReply(String name, String text) final inthashCode()Returns a hash code value for this object.iface()Returns the value of theifacerecord component.member()Returns the value of thememberrecord component.path()Returns the value of thepathrecord component.static intremaining(byte[] header) The number of bytes that follow the 16-byte fixed header.longReturns the value of thereplySerialrecord component.sender()Returns the value of thesenderrecord component.longserial()Returns the value of theserialrecord component.static MessageReturns the value of thesignaturerecord component.text()The first body value as text, or empty.final StringtoString()Returns a string representation of this record class.inttype()Returns the value of thetyperecord component.
-
Field Details
-
CALL
public static final int CALL- See Also:
-
RETURN
public static final int RETURN- See Also:
-
ERROR
public static final int ERROR- See Also:
-
SIGNAL
public static final int SIGNAL- See Also:
-
MAX_BYTES
public static final int MAX_BYTESThe largest message this client reads. The protocol allows more; no media player needs it.- See Also:
-
-
Constructor Details
-
Message
public Message(int type, long serial, long replySerial, String path, String iface, String member, String error, String destination, String sender, String signature, List<Object> body) Creates an instance of aMessagerecord class.- Parameters:
type- the value for thetyperecord componentserial- the value for theserialrecord componentreplySerial- the value for thereplySerialrecord componentpath- the value for thepathrecord componentiface- the value for theifacerecord componentmember- the value for thememberrecord componenterror- the value for theerrorrecord componentdestination- the value for thedestinationrecord componentsender- the value for thesenderrecord componentsignature- the value for thesignaturerecord componentbody- the value for thebodyrecord component
-
-
Method Details
-
call
-
signal
-
reply
-
errorReply
-
text
The first body value as text, or empty. Error replies carry their explanation there. -
encode
- Throws:
WireException
-
announced
The number of bytes after the fixed header, whatever its size; for skipping a message that is too large.- Throws:
WireException
-
remaining
The number of bytes that follow the 16-byte fixed header.- Throws:
WireException
-
decode
Decodes a complete message: the fixed header followed by everythingremaining(byte[])announced.- Throws:
WireException
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
type
-
serial
-
replySerial
public long replySerial()Returns the value of thereplySerialrecord component.- Returns:
- the value of the
replySerialrecord component
-
path
-
iface
-
member
-
error
-
destination
Returns the value of thedestinationrecord component.- Returns:
- the value of the
destinationrecord component
-
sender
-
signature
-
body
-