Annotation Type IntentParam
Names and describes one parameter of an AppIntent handler.
Every parameter of a handler needs one, except an optional leading
com.codename1.intents.IntentContext. Supported types are String, int,
long, float, double, boolean, java.util.Date, and any class
annotated IntentEntity.
-
Required Element Summary
Required Elements -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionThe value substituted when an optional parameter is absent.String[]A closed vocabulary of accepted values.booleanWhether the intent can run without this value.What the platform asks when it needs this value -- "Which playlist?".
-
Element Details
-
value
String valueThe parameter name used on the wire and in phrase placeholders. Required. -
title
String titleWhat the platform asks when it needs this value -- "Which playlist?".
Write it as a question to the user, because on iOS that is literally what Siri says out loud. Defaults to the parameter name, which is almost never what you want a user to hear.
- Default:
""
-
required
boolean requiredWhether the intent can run without this value. An unfilled required parameter is what triggers the platform's own picker.- Default:
true
-
defaultValue
String defaultValueThe value substituted when an optional parameter is absent.
Only meaningful alongside
required = false, and the build says so rather than letting the two contradict each other: the platforms resolve that contradiction differently, one treating the parameter as satisfied by the default and another still prompting for it.It must also be a value the parameter's type can actually hold, which the build checks too -- a default it cannot parse would otherwise become 0, false or null at runtime.
- Default:
""
-
options
String[] optionsA closed vocabulary of accepted values.
Stringparameters only.That restriction is enforced at build time because it is the only place it can be: the framework validates a vocabulary for strings and projects it to an iOS choice list, and nothing does either for other types -- so options elsewhere would advertise a restriction that nothing applies.
The platform offers these as choices rather than asking for free text, and the framework rejects anything else before your handler runs. Use it instead of declaring an enum type: an enum would need its own resolution machinery on every platform for no gain over a checked string.
- Default:
{}
-