Class IntentParameterInfo
IntentParam
annotation; applications read these but never construct them.-
Constructor Summary
ConstructorsConstructorDescriptionIntentParameterInfo(String name, String title, IntentParameterType type, boolean required, String entityType, String defaultValue, List<String> options) Framework entry point: builds a parameter description.IntentParameterInfo(String name, String title, IntentParameterType type, boolean required, String entityType, String defaultValue, List<String> options, int numericWidthBits) The same, carrying the width the handler actually declared. -
Method Summary
Modifier and TypeMethodDescriptionThe value substituted when an optional parameter is absent, or null.The entity type id whengetType()isIntentParameterType.ENTITY, otherwise null.getName()The parameter name used on the wire and in the parameter map.intThe width the handler declared for a numeric parameter: 32 forintandfloat, 64 forlonganddouble, and 0 when it is not known.The closed vocabulary this parameter accepts, or an empty list when any value is allowed.getTitle()The prompt the platform shows when it has to ask for this value -- "Which playlist?".getType()The parameter kind.booleanWhether the intent can run without this value.toString()Returns a string representation of the object.
-
Constructor Details
-
IntentParameterInfo
public IntentParameterInfo(String name, String title, IntentParameterType type, boolean required, String entityType, String defaultValue, List<String> options) Framework entry point: builds a parameter description. Called by generated code.
Parameters
name: the parameter name used on the wiretitle: the prompt shown when the platform asks for this valuetype: the parameter kindrequired: whether the intent can run without itentityType: the entity type id whentypeisENTITY, else nulldefaultValue: the value used when an optional parameter is absentoptions: the closed vocabulary, or null when the value is free
-
IntentParameterInfo
public IntentParameterInfo(String name, String title, IntentParameterType type, boolean required, String entityType, String defaultValue, List<String> options, int numericWidthBits) The same, carrying the width the handler actually declared.
Parameters
numericWidthBits: 32 forintandfloat, 64 forlonganddouble, 0 when the declaration does not record it
-
-
Method Details
-
getName
The parameter name used on the wire and in the parameter map. -
getTitle
The prompt the platform shows when it has to ask for this value -- "Which playlist?". Falls back to the name when the declaration gave none. -
getType
The parameter kind. -
isRequired
public boolean isRequired()Whether the intent can run without this value. -
getEntityType
The entity type id whengetType()isIntentParameterType.ENTITY, otherwise null. -
getDefaultValue
The value substituted when an optional parameter is absent, or null. -
getNumericWidthBits
public int getNumericWidthBits()The width the handler declared for a numeric parameter: 32 for
intandfloat, 64 forlonganddouble, and 0 when it is not known.getType()collapsesintwithlongintoINTEGERandfloatwithdoubleintoNUMBER, which is the right granularity for a platform that has one number type -- but it left the framework unable to tell whether 5000000000 was a value this handler could hold. Guessing was wrong in both directions: guessing wide published donations that fail on every tap for anintparameter, guessing narrow refused donations alongwould have run. The generated declarations record it, so there is nothing to guess. -
getOptions
-
toString
Description copied from class:ObjectReturns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method. The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of: getClass().getName() + '@' + Integer.toHexString(hashCode())
-