Enum Class MessageType

java.lang.Object
java.lang.Enum<MessageType>
com.lucimber.dbus.message.MessageType
All Implemented Interfaces:
Serializable, Comparable<MessageType>, Constable

public enum MessageType extends Enum<MessageType>
D-Bus message types as defined in the D-Bus wire protocol.

Each message begins with a single byte indicating its type.

Since:
1.0
See Also:
  • Enum Constant Details

    • METHOD_CALL

      public static final MessageType METHOD_CALL
      Method call request. Bit mask: 0x01
    • METHOD_RETURN

      public static final MessageType METHOD_RETURN
      Method return (reply). Bit mask: 0x02
    • ERROR

      public static final MessageType ERROR
      Error reply. Bit mask: 0x03
    • SIGNAL

      public static final MessageType SIGNAL
      Signal emission. Bit mask: 0x04
  • Method Details

    • values

      public static MessageType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static MessageType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • fromCode

      public static MessageType fromCode(byte code)
      Looks up a MessageType by its byte code.
      Parameters:
      code - the byte code from the wire
      Returns:
      the matching MessageType
      Throws:
      IllegalArgumentException - if the code is unrecognized
    • getCode

      public byte getCode()
      Returns the byte code corresponding to this message type.
      Returns:
      the D-Bus message type code