org.terracotta.ipceventbus.event
Interface Event


public interface Event

Author:
Mathieu Carbou

Method Summary
 Object getData()
           
<T> T
getData(Class<T> type)
          Convert the raw data in given type
<T> T
getData(Class<T> type, T defaultValue)
           
 String getName()
           
 String getSource()
           
 long getTimestamp()
           
 boolean isUserEvent()
           
 

Method Detail

isUserEvent

boolean isUserEvent()

getSource

String getSource()
Returns:
The ID of the EventBus where the event comes from. Same as EventSender.getId()

getName

String getName()
Returns:
The event name triggered

getTimestamp

long getTimestamp()
Returns:
The millisecond timestamp of this event

getData

Object getData()
Returns:
The raw data of this event, if any

getData

<T> T getData(Class<T> type)
Convert the raw data in given type

Type Parameters:
T - The type to cast the raw data into
Parameters:
type - Teh class of wanted type
Returns:
The catsed raw data

getData

<T> T getData(Class<T> type,
              T defaultValue)


Copyright © 2015. All rights reserved.