Class Layer1ApiAlertSettingsMessage
- All Implemented Interfaces:
Layer1ApiStrategiesEchoMessagesLayer.StrategyEchoMessageFromLayer
public class Layer1ApiAlertSettingsMessage extends java.lang.Object implements Layer1ApiStrategiesEchoMessagesLayer.StrategyEchoMessageFromLayer
Bookmap sends this message to the addon, if a user changed alert settings via GUI.
Your addon should listen for these messages via Layer1ApiAdminListener.onUserMessage(Object)
and change its inner state accordingly, so the following Layer1ApiSoundAlertMessage's
sent by the addon have correct settings.
Internally Bookmap stores these settings, and checks the sound alert messages
for conformity with the expected settings. If they diverge, that is - a sound alert
message arrived with Layer1ApiSoundAlertMessage.sound = true,
while there is a settings message registered with sound = false
- an exception will be thrown, and the addon will be unloaded.
Your addon can also send this message to notify Bookmap about sound alert settings changes.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classLayer1ApiAlertSettingsMessage.Builder -
Field Summary
Fields Modifier and Type Field Description java.lang.StringdeclarationIdTheLayer1ApiSoundAlertDeclarationMessage.idof a linked alert declaration
Note that if you specify this field, in the Bookmap there should already exist a registered declaration with the given id.java.lang.StringidId can be used to reference this messagebooleanpopupTrue if the sound alerts described with a linked alert declaration have a popup notificationbooleansoundTrue if the sound alerts described with a linked alert declaration have a sound notificationjava.lang.Class<?>sourceClass that created this message. -
Method Summary
Modifier and Type Method Description static Layer1ApiAlertSettingsMessage.Builderbuilder()Creates builder to buildLayer1ApiSoundAlertMessage.static Layer1ApiAlertSettingsMessagedefaultSettings(java.lang.String declarationId, java.lang.Class<?> source)java.lang.StringtoString()
-
Field Details
-
id
public final java.lang.String idId can be used to reference this message -
declarationId
public final java.lang.String declarationIdTheLayer1ApiSoundAlertDeclarationMessage.idof a linked alert declaration
Note that if you specify this field, in the Bookmap there should already exist a registered declaration with the given id. -
popup
public final boolean popupTrue if the sound alerts described with a linked alert declaration have a popup notification -
sound
public final boolean soundTrue if the sound alerts described with a linked alert declaration have a sound notification -
source
public final java.lang.Class<?> sourceClass that created this message. Must be annotated byLayer1StrategyName
-
-
Method Details
-
defaultSettings
public static Layer1ApiAlertSettingsMessage defaultSettings(java.lang.String declarationId, java.lang.Class<?> source)- Returns:
- default settings
-
builder
Creates builder to buildLayer1ApiSoundAlertMessage.- Returns:
- created builder
-
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-