public class Event
extends EventBase
Modifier and Type | Class and Description |
---|---|
static class |
Event.Builder |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getKey() |
<T> T |
getParam(int index)
Returns value at
index position and implicitly casts it to T . |
int |
getParamsCount() |
<T> T |
getTag(int index)
Returns value at
index position and implicitly casts it to T . |
int |
getTagsCount() |
static boolean |
isDeeplyEqual(Event e1,
Event e2)
Two events are considered deeply equal if they have same key and exactly same
parameters lists.
|
Event |
postResult(EventResult result)
Schedules event's
result to be passed to all available subscribers.This method should only be called inside of method marked with Events.Subscribe .See Events.Result . |
Event |
postResult(java.lang.Object... params)
|
public java.lang.String getKey()
public <T> T getParam(int index)
index
position and implicitly casts it to T
.
Returns null
if there is no value for specified index
.public int getParamsCount()
public <T> T getTag(int index)
index
position and implicitly casts it to T
.
Returns null
if there is no value for specified index
.public int getTagsCount()
public Event postResult(EventResult result)
result
to be passed to all available subscribers.Events.Subscribe
.Events.Result
.public Event postResult(java.lang.Object... params)
public static boolean isDeeplyEqual(Event e1, Event e2)
Two events are considered deeply equal if they have same key and exactly same parameters lists.
Parameters are compared using Arrays.deepEquals(Object[], Object[])
, so be sure
to have correct implementation of Object.equals(Object)
method for all parameters.
If you don't want some of parameters to be compared pass them as tags using
Event.Builder.tag(Object...)
builder method.