Class Message
- java.lang.Object
-
- org.deepsymmetry.libcarabiner.Message
-
public class Message extends Object
Simplifies the interpretation of messages sent by Carabiner by converting them from their Extensible Data Notation format to more familiar Java structures. Each message consists of a type symbol, optionally followed by a map of keywords and values. Constructing a
Messageobject provides easy access to those values, with the symbol and keywords replaced by ordinary interned JavaStringinstances.For example, if instantiated with the string
"status { :peers 0 :bpm 120.000000 :start 73743731220 :beat 597.737570 }", aMessageinstance would have amessageTypeof"status", and itsdetailswould be aMapwith keys"peers"(holding theLongvalue0),"bpm"(holding theDoublevalue120.0),"start"(holding theLongvalue73743731220), and"beat"(holding theDoublevalue597.737570).An instance constructed with the string
"bad-beat"would have amessageTypeof"bad-beat"and anulldetails.Once constructed, Message objects are immutable data holders.
Created by James Elliott on 2020-01-19.
-
-
Field Detail
-
messageType
public final String messageType
Identifies the type of the message that was received, which was the symbol that the message started with. This value is interned, so message types can be compared for equality by object identity.
-
-