Package velox.api.layer1.messages
Class Layer1ApiSoundAlertMessage
java.lang.Object
velox.api.layer1.messages.Layer1ApiSoundAlertMessage
- All Implemented Interfaces:
Layer1ApiStrategiesEchoMessagesLayer.StrategyEchoMessageFromLayer
public class Layer1ApiSoundAlertMessage extends java.lang.Object implements Layer1ApiStrategiesEchoMessagesLayer.StrategyEchoMessageFromLayer
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Layer1ApiSoundAlertMessage.SoundAlertStatus
static interface
Layer1ApiSoundAlertMessage.SoundAlertStatusListener
-
Field Summary
Fields Modifier and Type Field Description java.lang.String
alertId
This ID can be used to reference alert later (stop it)java.lang.Object
metadata
This field will not be used anywhere outside of strategy code, but strategy can later use this field, for example, to determine if this message should be cancelled inLayer1ApiSoundAlertCancelMessage.Layer1ApiSoundMessagesFilter.shouldCancelMessage(Layer1ApiSoundAlertMessage)
static long
REPEAT_COUNT_INFINITE
long
repeatCount
Number of times sound will be repeated orREPEAT_COUNT_INFINITE
for infinite replay (until cancelled by user).java.time.Duration
repeatDelay
Delay between sound repetitions.byte[]
sound
Binary data for the sound to be played.java.lang.Class<?>
source
Class that created this messageLayer1ApiSoundAlertMessage.SoundAlertStatusListener
statusListener
java.lang.String
textInfo
Text description of a message, will be displyed in alerts dialog -
Constructor Summary
Constructors Constructor Description Layer1ApiSoundAlertMessage(byte[] sound, java.lang.String textInfo, long repeatCount, java.time.Duration repeatDelay, Layer1ApiSoundAlertMessage.SoundAlertStatusListener statusListener, java.lang.Class<?> source, java.lang.Object metadata)
Creates a message that will launch an alertLayer1ApiSoundAlertMessage(java.lang.String alertId)
Creates a message that will stop an alert with specified alertId -
Method Summary
Modifier and Type Method Description java.lang.String
toString()
-
Field Details
-
REPEAT_COUNT_INFINITE
public static final long REPEAT_COUNT_INFINITE- See Also:
- Constant Field Values
-
sound
public final byte[] soundBinary data for the sound to be played. Please do not modify array after you pass it to the message. Multiple messages can share same sound data. -
textInfo
public final java.lang.String textInfoText description of a message, will be displyed in alerts dialog -
repeatCount
public final long repeatCountNumber of times sound will be repeated orREPEAT_COUNT_INFINITE
for infinite replay (until cancelled by user). -
repeatDelay
public final java.time.Duration repeatDelayDelay between sound repetitions. -
alertId
public final java.lang.String alertIdThis ID can be used to reference alert later (stop it) -
statusListener
-
source
public final java.lang.Class<?> sourceClass that created this message -
metadata
public final java.lang.Object metadataThis field will not be used anywhere outside of strategy code, but strategy can later use this field, for example, to determine if this message should be cancelled inLayer1ApiSoundAlertCancelMessage.Layer1ApiSoundMessagesFilter.shouldCancelMessage(Layer1ApiSoundAlertMessage)
-
-
Constructor Details
-
Layer1ApiSoundAlertMessage
public Layer1ApiSoundAlertMessage(byte[] sound, java.lang.String textInfo, long repeatCount, java.time.Duration repeatDelay, Layer1ApiSoundAlertMessage.SoundAlertStatusListener statusListener, java.lang.Class<?> source, java.lang.Object metadata)Creates a message that will launch an alert -
Layer1ApiSoundAlertMessage
public Layer1ApiSoundAlertMessage(java.lang.String alertId)Creates a message that will stop an alert with specified alertId
-
-
Method Details
-
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-