Class Layer1ApiSoundAlertDeclarationMessage
- All Implemented Interfaces:
Layer1ApiStrategiesEchoMessagesLayer.StrategyEchoMessageFromLayer
public class Layer1ApiSoundAlertDeclarationMessage extends java.lang.Object implements Layer1ApiStrategiesEchoMessagesLayer.StrategyEchoMessageFromLayer
Use this message to declare your addon intents of sending alerts to a user.
The class specifies a "blueprint" of future alerts group. Send created message
via Layer1ApiAdminProvider.sendUserMessage(Object), and link the
declaration message to an alert via Layer1ApiSoundAlertMessage.alertDeclarationId
The Bookmap caches these messages internally, and if your Layer1ApiSoundAlertMessage
with a linked Layer1ApiSoundAlertDeclarationMessage does not conform
the fields specified in the declaration message - an exception will be thrown,
and your addon will be unloaded.
When a user removes a declaration from GUI - your addon will receive this
message with flag isAdd = false
That is, your addon needs to listen for these messages using
Layer1ApiAdminListener.onUserMessage(Object)
- See Also:
Layer1ApiSoundAlertMessage
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classLayer1ApiSoundAlertDeclarationMessage.Builder -
Field Summary
Fields Modifier and Type Field Description static java.util.function.Predicate<java.lang.String>ALIAS_MATCH_ALLUse it as thealiasMatchervalue, to indicate that the current declaration is linked to all available aliasesjava.util.function.Predicate<java.lang.String>aliasMatcherThe predicate obtains an instrument alias.java.lang.StringidId can be used to reference this declaration messagebooleanisAddTrue if this message adds a declaration.booleanisPopupAllowedDefine whether an alert can have a popup notification
The actual state of the popup notification (on/off) is defined withLayer1ApiAlertSettingsMessage.popupbooleanisRepeatedTrue if alerts described by this declaration are repeated -Layer1ApiSoundAlertMessage.repeatCount> 1booleanisSoundAllowedDefine whether an alert can have a sound notification
The actual state of the sound notification (on/off) is defined withLayer1ApiAlertSettingsMessage.soundjava.lang.Class<?>sourceClass that created this message.java.lang.StringstrategyNameName of the strategy that created this message, extracted fromLayer1StrategyName.value(), displayed on the UIjava.lang.StringtriggerDescriptionShort description of the trigger event for this declaration. -
Method Summary
Modifier and Type Method Description static Layer1ApiSoundAlertDeclarationMessage.Builderbuilder()Creates builder to buildLayer1ApiSoundAlertDeclarationMessage.java.lang.StringtoString()
-
Field Details
-
ALIAS_MATCH_ALL
public static final java.util.function.Predicate<java.lang.String> ALIAS_MATCH_ALLUse it as thealiasMatchervalue, to indicate that the current declaration is linked to all available aliases -
id
public final java.lang.String idId can be used to reference this declaration message -
triggerDescription
public final java.lang.String triggerDescriptionShort description of the trigger event for this declaration. Will be shown on the UI -
source
public final java.lang.Class<?> sourceClass that created this message. The class must haveLayer1StrategyNameannotation present -
strategyName
public final java.lang.String strategyNameName of the strategy that created this message, extracted fromLayer1StrategyName.value(), displayed on the UI -
aliasMatcher
public final java.util.function.Predicate<java.lang.String> aliasMatcherThe predicate obtains an instrument alias. If it returns true, the declaration is believed to be linked to the specified alias. Used internally for declarations filtration on the UI -
isPopupAllowed
public final boolean isPopupAllowedDefine whether an alert can have a popup notification
The actual state of the popup notification (on/off) is defined withLayer1ApiAlertSettingsMessage.popup -
isSoundAllowed
public final boolean isSoundAllowedDefine whether an alert can have a sound notification
The actual state of the sound notification (on/off) is defined withLayer1ApiAlertSettingsMessage.sound -
isRepeated
public final boolean isRepeatedTrue if alerts described by this declaration are repeated -Layer1ApiSoundAlertMessage.repeatCount> 1 -
isAdd
public final boolean isAddTrue if this message adds a declaration. Otherwise, the declaration with the sameidwill be removed
-
-
Method Details
-
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-
builder
Creates builder to buildLayer1ApiSoundAlertDeclarationMessage.- Returns:
- created builder
-