public static final class NotificationUserInput.Builder extends Object
NotificationUserInput object.SystemCapability.Notification#ANS| 构造器 | 说明 |
|---|---|
Builder(String inputKey) |
A constructor used to create a
Builder instance for creating NotificationUserInput objects. |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
NotificationUserInput.Builder |
addAdditionalData(PacMap pacMap) |
Adds additional data to this
Builder. |
NotificationUserInput |
build() |
Creates a new
NotificationUserInput object by using all of the settings. |
NotificationUserInput.Builder |
setEditType(NotificationConstant.InputEditType editType) |
Sets the edit type of the options provided by this
NotificationUserInput object. |
NotificationUserInput.Builder |
setOptions(List<String> options) |
Sets the options provided to users to satisfy user input needs.
|
NotificationUserInput.Builder |
setPermitFreeFormInput(boolean permitFreeFormInput) |
Sets whether users can input arbitrary text values.
|
NotificationUserInput.Builder |
setPermitMimeTypes(String mimeType,
boolean doPermit) |
Sets whether users can input values of the given MIME type.
|
NotificationUserInput.Builder |
setTag(String tag) |
Sets the tag to be displayed to the user when collecting this input from the user.
|
public Builder(String inputKey)
Builder instance for creating NotificationUserInput objects.inputKey - Indicates the PacMap key used to identify this input when
the input is collected from the user.IllegalArgumentException - Throws this exception if inputKey is null.public NotificationUserInput.Builder setTag(String tag)
tag - Indicates the tag to be displayed.Builder object.public NotificationUserInput.Builder setOptions(List<String> options)
options - Indicates the list of predefined options to be provided for user input.Builder object.public NotificationUserInput.Builder setPermitMimeTypes(String mimeType, boolean doPermit)
mimeType - Indicates the MIME type allowed. If this parameter is null, this method returns
the original Builder object.doPermit - Specifies whether to allow the given MIME type. The value true means to allow it,
and the value false means not.Builder object.public NotificationUserInput.Builder setPermitFreeFormInput(boolean permitFreeFormInput)
permitFreeFormInput - Specifies whether to allow arbitrary text values. The default value is
true, indicating that arbitrary text values are allowed. If this parameter is set to false,
you must either call setOptions(java.util.List<java.lang.String>) to set a non-null and non-empty list or call
setPermitMimeTypes(java.lang.String, boolean) to allow a MIME type. Otherwise, an IllegalArgumentException will
be thrown.Builder object.public NotificationUserInput.Builder addAdditionalData(PacMap pacMap)
Builder. The value of pacMap will replace the existing
extras value in this Builder.pacMap - Indicates the PacMap object containing the additional data.Builder object.public NotificationUserInput.Builder setEditType(NotificationConstant.InputEditType editType)
NotificationUserInput object.
The edit type determines whether an option can be edited when the user taps the option.
editType - Indicates the edit type to set. For details about available values,
see NotificationConstant.InputEditType.Builder object.public NotificationUserInput build()
NotificationUserInput object by using all of the settings.NotificationUserInput object.