public class Event extends Object implements Serializable
Parser
.
After being parsed, all events are guaranteed to have an associated Payload
value
which contains information related to a specific type of event.
Specific parser implementations may also add Normalized
data fields to the event.
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
static Event |
fromJSON(String input)
Convert a JSON string into an
Event |
UUID |
getEventId()
Get unique event ID.
|
Mozlog |
getMozlog()
Get mozlog value
|
Normalized |
getNormalized()
Return normalized data set.
|
<T extends PayloadBase> |
getPayload()
Get event payload.
|
Payload.PayloadType |
getPayloadType()
Return the type of payload data associated with this event.
|
String |
getStackdriverLabel(String key)
Get specific Stackdriver label value
|
Map<String,String> |
getStackdriverLabels()
Get Stackdriver labels
|
String |
getStackdriverProject()
Get Stackdriver project name
|
org.joda.time.DateTime |
getTimestamp()
Get event timestamp.
|
int |
hashCode() |
static String |
iterableToJson(Iterable<Event> input)
Utility function to convert an iterable list of events into a JSON string
|
static Iterable<Event> |
jsonToIterable(String input)
Utility function to convert a JSON string into an iterable list of events
|
void |
setMozlog(Mozlog mozlog)
Set mozlog value
|
<T extends PayloadBase> |
setPayload(T p)
Set event payload.
|
void |
setStackdriverLabels(Map<String,String> labels)
Set Stackdriver labels
|
void |
setStackdriverProject(String project)
Set Stackdriver project name
|
void |
setTimestamp(org.joda.time.DateTime t)
Set event timestamp.
|
String |
toJSON()
Convert event into JSON string representation
|
public <T extends PayloadBase> void setPayload(T p)
T
- Tp
- Payload data.public <T extends PayloadBase> T getPayload()
T
- TPayloadBase
.public Payload.PayloadType getPayloadType()
Payload.PayloadType
public void setMozlog(Mozlog mozlog)
If the mozlog entry has a timestamp value, this timestamp will be used for the event timestamp.
mozlog
- Mozlog values for eventpublic void setStackdriverProject(String project)
project
- Project stringpublic String getStackdriverProject()
public void setStackdriverLabels(Map<String,String> labels)
labels
- Labelspublic Map<String,String> getStackdriverLabels()
public String getStackdriverLabel(String key)
key
- Label key to return value forpublic org.joda.time.DateTime getTimestamp()
public void setTimestamp(org.joda.time.DateTime t)
t
- DateTime
to associate with event.public Normalized getNormalized()
Normalized
data associated with event.public String toJSON()
public static Event fromJSON(String input)
Event
input
- Input JSON stringpublic static Iterable<Event> jsonToIterable(String input)
input
- Input JSON stringCopyright © 2022. All rights reserved.