Package com.adobe.marketing.mobile
Class Event.Builder
-
- All Implemented Interfaces:
public class Event.BuilderEvent Builder
-
-
Constructor Summary
Constructors Constructor Description Event.Builder(String name, String type, String source)Builder constructor with required Eventattributes as parametersEvent.Builder(String name, String type, String source, Array<String> mask)Builder constructor with required Eventattributes as parameters
-
Method Summary
Modifier and Type Method Description Event.BuildersetEventData(Map<String, Object> data)Sets the data for this Event.Eventbuild()Builds and returns the Eventobject.Event.BuilderinResponseToEvent(Event requestEvent)Sets this as response for requestEvent.Event.BuilderchainToParentEvent(@NonNull() Event parentEvent)Sets parent event for this event. -
-
Constructor Detail
-
Event.Builder
Event.Builder(String name, String type, String source)
Builder constructor with requiredEventattributes as parameters- Parameters:
name- requiredStringto be set as event name; should not be null or empty stringtype- requiredStringto be set as event type; should not be null or empty stringsource- requiredStringto be set as event source; should not be null or empty string
-
Event.Builder
Event.Builder(String name, String type, String source, Array<String> mask)
Builder constructor with requiredEventattributes as parameters- Parameters:
name- requiredStringto be set as event name; should not be null or empty stringtype- requiredStringto be set as event type; should not be null or empty stringsource- requiredStringto be set as event source; should not be null or empty stringmask-String[]event mask
-
-
Method Detail
-
setEventData
Event.Builder setEventData(Map<String, Object> data)
Sets the data for this
Event. The keys should be of typeString.Note: Custom classes are not supported as value types. These values will be skipped from the
Eventdata.The accepted value types are:
BooleanByteCollection<Object>DoubleFloatIntegerStringList<Object>LongMap<String, Object>Short- null
-
build
Event build()
Builds and returns the
Eventobject. It returns null if the event's type or source are null- Returns:
the constructed Event or null if the type or source are null
-
inResponseToEvent
Event.Builder inResponseToEvent(Event requestEvent)
Sets this as response for
requestEvent. Additionally, marksrequestEventas the parent event to this event.- Parameters:
requestEvent-Eventevent- Returns:
this Event Builder
-
chainToParentEvent
Event.Builder chainToParentEvent(@NonNull() Event parentEvent)
Sets parent event for this event.
- Parameters:
parentEvent- theEventto be set as the parent event.- Returns:
this Event.Builder
-
-
-
-