目录

ContentData

Class Info

public class ContentData

Content data. One message can be used to send multiple records of content data, which corresponds to one event.

Note that the total number of Header and Payload keys should be less than 100.

Public Method Summary

Qualifier and Type

Method Name

ContentData

setHeader(String key, String value)

ContentData

setPayload(String key, JSONObject value)

ContentData

setPayload(String key, String value)

ContentData

setPayload(String key, String[] value)

ContentData

setPayload(String key, Boolean value)

Public Methods

[h2]setHeader

Method

public ContentData setHeader(String key, String value)

Sets Header, which includes the following fields: namespace and name.

Parameters

Name

Description

key

Key of Header, which includes the following fields: namespace and name.

value

Value of Header

Field Summary

Name

Type

Mandatory

Description

namespace

String

Yes

Namespace.

Example: event, which indicates an event.

name

String

Yes

Name of the data to be donated.

Example: featurePrediction, which indicates feature prediction.

Returns

Type

Description

ContentData

ContentData object.

[h2]setPayload(String key, JSONObject value)

Method

public ContentData setPayload(String key, JSONObject value)

Sets Payload, which includes the following fields: eventCommonInfo, predictInfo, and faFormInfo.

Parameters

Name

Description

key

Key of Payload, which includes the following fields: eventCommonInfo, predictInfo, and faFormInfo.

value

Value of Payload.

Field Summary

Name

Type

Mandatory

Description

eventCommonInfo

jsonString

Yes

Public description of an event.

predictInfo

jsonString

Yes

Information of feature prediction.

faFormInfo

jsonString

Yes

FA widget information.

Returns

Type

Description

ContentData

ContentData object.

[h2]setPayload(String key, String value)

Method

public ContentData setPayload(String key, String value)

Sets Payload, which includes the following fields: identifier and intentVersion.

Parameters

Name

Description

key

Key of Payload, which includes the following fields: identifier and intentVersion.

value

Value of Payload.

Field Summary

Name

Type

Mandatory

Description

identifier

String

Yes

ID of the to-be-shared data under an Intent.

intentVersion

String

Yes

Intent version number.

Returns

Type

Description

ContentData

ContentData object.

[h2]setPayload(String key, String[] value)

Method

public ContentData setPayload(String key, String[] value)

Sets Payload, which includes the following fields: identifiers and entityIds.

Parameters

Name

Description

key

Key of Payload, which includes the following fields: identifiers and entityIds.

value

Value of Payload.

Field Summary

Name

Type

Mandatory

Description

identifiers

String[]

Yes

IDs of the data under an Intent.

entityIds

String[]

Yes

IDs of an entity. When this field is passed to deleteEntity, the entity in different Intents will be deleted, based on the specified entity IDs in those Intents.

Returns

Type

Description

ContentData

ContentData object.

[h2]setPayload(String key, Boolean value)

Method

public ContentData setPayload(String key, Boolean value)

Sets Payload, which includes the renew field.

Parameters

Name

Description

key

Payload key, including the renew field.

value

Value of Payload.

Field Summary

Name

Type

Mandatory

Description

renew

Boolean

Yes

Whether to obtain a new service open ID from the cloud.

Returns

Type

Description

ContentData

ContentData object.