| 构造器 | 说明 |
|---|---|
VoiceEvent(String speech) |
A constructor used to create a
VoiceEvent instance based on the hot words. |
VoiceEvent(String speech,
int scene,
boolean isUseBadge) |
A constructor used to create a
VoiceEvent instance based on the hot words, event scene, and whether
to use the event badge. |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
void |
addBadges(String from,
String to) |
Sets start and end event badges for a scene.
|
void |
addSynonyms(String synonyms) |
Adds synonyms to the voice event.
|
List<String[]> |
getBadge() |
Gets the event Badge.
|
int |
getScene() |
Gets the event scene.
|
String |
getSpeech() |
Gets the event Speech.
|
List<String> |
getSynonyms() |
Gets the event Synonyms.
|
void |
sendDataToComponent(Component component) |
Binds this object to a component.
|
void |
setBadge(boolean enable) |
Sets the event badge.
|
void |
setScene(int scene) |
Sets the event scene.
|
public VoiceEvent(String speech, int scene, boolean isUseBadge)
VoiceEvent instance based on the hot words, event scene, and whether
to use the event badge.speech - Indicates the hot words.scene - Indicates the scene where this event is used.isUseBadge - Specifies whether the event badge will be used. Value true indicates to use the
badge, and false indicates the opposite.public VoiceEvent(String speech)
VoiceEvent instance based on the hot words.speech - Indicates the hot words.public void addSynonyms(String synonyms)
synonyms - Indicates the synonyms to add.public void setScene(int scene)
scene - Indicates the scene where the event will be used.public void setBadge(boolean enable)
enable - Specifies whether to enable the event badge. Value true indicates to enable the
badge, and false indicates to disable the badge.public void addBadges(String from, String to)
from - Indicates the start event badge.to - Indicates the end event badge.public String getSpeech()
public List<String> getSynonyms()
public List<String[]> getBadge()
public int getScene()
public void sendDataToComponent(Component component)
component - Indicates the component to bind.