public static class

PreChatField.Builder

extends Object
java.lang.Object
   ↳ com.salesforce.android.chat.core.model.PreChatField.Builder

This class is deprecated.
Deprecated in favor of ChatUserData.

Summary

Public Constructors
Builder()
Public Methods
PreChatField.Builder addPickListOption(PreChatField.PickListOption pickListOption)
Set a single PreChatField.PickListOption to the field.
PreChatField build(String fieldName, String displayName, String type)
Builds and returns an instance of PreChatField.
PreChatField.Builder displayedToAgent(boolean isDisplayedToAgent)
Whether or not this field should be displayed to the Agent.
PreChatField.Builder extraTypeInfo(String extraTypeInfo)
Supplies additional information which describes the function of the field.
PreChatField.Builder hidden(boolean isHidden)
Whether this field should be exposed to the UI.
PreChatField.Builder mapToChatTranscriptField(String... transcriptFields)
A list of API Names for Live Chat Transcript Custom Fields that this pre-chat field will map to.
PreChatField.Builder maxValueLength(Integer maxValueLength)
The maximum length for the value this field expects.
PreChatField.Builder picklistOptions(List<PreChatField.PickListOption> picklistOptions)
Set a list of PreChatField.PickListOption values to be associated with this field.
PreChatField.Builder picklistOptions(PickListOption... picklistOptions)
Set a list of PreChatField.PickListOption values to be associated with this field.
PreChatField.Builder readOnly(Boolean readOnly)
Used as an indicator that the value shouldn't be changed.
PreChatField.Builder required(Boolean required)
Used as an indicator that the field should be supplied with a value.
PreChatField.Builder value(Serializable value)
Set the initial value of the field.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public Builder ()

Public Methods

public PreChatField.Builder addPickListOption (PreChatField.PickListOption pickListOption)

Set a single PreChatField.PickListOption to the field.

Parameters
pickListOption the PickListOption
Returns
  • A reference to this builder instance.

public PreChatField build (String fieldName, String displayName, String type)

Builds and returns an instance of PreChatField.

Parameters
fieldName the label to display next to the prechat info on the agent console.
displayName the display name which should be used if displaying this input to a user.
type the type of input this field is expected to be.
Returns

public PreChatField.Builder displayedToAgent (boolean isDisplayedToAgent)

Whether or not this field should be displayed to the Agent. Default value is true.

Parameters
isDisplayedToAgent True if the field should be displayed to the Agent.
Returns
  • A reference to this builder instance.

public PreChatField.Builder extraTypeInfo (String extraTypeInfo)

Supplies additional information which describes the function of the field.

Parameters
extraTypeInfo extra type information about this field.
Returns
  • A reference to this builder instance.

public PreChatField.Builder hidden (boolean isHidden)

Whether this field should be exposed to the UI. Useful if you wish to set values which should not be displayed to the user. The default UI package will respect this flag.

Parameters
isHidden boolean which if true suggests to the UI that it should not be displayed.
Returns
  • A reference to this builder instance.

public PreChatField.Builder mapToChatTranscriptField (String... transcriptFields)

A list of API Names for Live Chat Transcript Custom Fields that this pre-chat field will map to. The value set for this field will be displayed as part of the Live Chat Transcript.

Parameters
transcriptFields A list of Live Chat Transcript Field API Names
Returns
  • A reference to this builder instance.

public PreChatField.Builder maxValueLength (Integer maxValueLength)

The maximum length for the value this field expects.

Parameters
maxValueLength set the maximum expected length. 0 is unlimited.
Returns
  • A reference to this builder instance.

public PreChatField.Builder picklistOptions (List<PreChatField.PickListOption> picklistOptions)

Set a list of PreChatField.PickListOption values to be associated with this field.

Parameters
picklistOptions the list of PreChatField.PickListOption associated with this field.
Returns
  • A reference to this builder instance.

public PreChatField.Builder picklistOptions (PickListOption... picklistOptions)

Set a list of PreChatField.PickListOption values to be associated with this field.

Parameters
picklistOptions the list of PreChatField.PickListOption associated with this field.
Returns
  • A reference to this builder instance.

public PreChatField.Builder readOnly (Boolean readOnly)

Used as an indicator that the value shouldn't be changed. Fields which are marked as readOnly will ignore changes on the setValue(Serializable).

Parameters
readOnly whether this field should be writable.
Returns
  • A reference to this builder instance.

public PreChatField.Builder required (Boolean required)

Used as an indicator that the field should be supplied with a value. This can only be enforced locally.

Parameters
required whether this field should require a value.
Returns
  • A reference to this builder instance.

public PreChatField.Builder value (Serializable value)

Set the initial value of the field.

Parameters
value the initial value to set on the field.
Returns
  • A reference to this builder instance.