public final class Event
extends java.lang.Object
implements java.io.Serializable
Analytics.logEvent(Event)
.
Example :
Map map = new HashMap();
map.put("customEventPropertyKey", "customEventPropertyValue");
Event event = new Event("Mobile SDK Event", new Date(), map);
Constructor and Description |
---|
Event(java.lang.String name,
java.util.Date timestamp,
java.util.Map<java.lang.String,java.lang.String> properties)
Creates a new event object with specified name, timestamp and custom properties.
|
Modifier and Type | Method and Description |
---|---|
void |
addProperty(java.lang.String key,
java.lang.String value)
Adds a property to the existing Map of event properties.
|
java.lang.String |
getName()
Returns the name of the event.
|
java.util.Map<java.lang.String,java.lang.String> |
getProperties()
Returns properties associated with the event.
|
java.util.Date |
getTimestamp()
Returns the date that the event was recorded.
|
void |
setTimestamp(java.util.Date timestamp)
Sets the time at which the event was recorded.
|
public Event(java.lang.String name, java.util.Date timestamp, java.util.Map<java.lang.String,java.lang.String> properties)
name
- Name of the eventtimestamp
- Time the event was recordedproperties
- Custom Properties of the eventpublic java.util.Map<java.lang.String,java.lang.String> getProperties()
public java.util.Date getTimestamp()
public void setTimestamp(java.util.Date timestamp)
timestamp
- Timestamppublic java.lang.String getName()
public void addProperty(java.lang.String key, java.lang.String value)
key
- String keyvalue
- Value to be stored against the key