public class StreamingEvent
extends java.lang.Object
Gson instance to convert the data string.| Modifier and Type | Class and Description |
|---|---|
static class |
StreamingEvent.EventType
Enum describing the different event types to be returned by the Firebase streaming service.
|
| Constructor and Description |
|---|
StreamingEvent(com.google.gson.Gson gson,
StreamingEvent.EventType eventType,
java.lang.String eventData) |
| Modifier and Type | Method and Description |
|---|---|
StreamingEventData |
getEventData()
Returns the
StreamingEventData without additional type context information. |
<T> StreamingEventData<T> |
getEventData(com.google.gson.reflect.TypeToken<StreamingEventData<T>> typeToken)
Returns the
StreamingEventData without additional type context information. |
StreamingEvent.EventType |
getEventType()
Returns the
StreamingEvent.EventType for the individual event. |
java.lang.String |
getSerialzedEventData()
Returns the raw string of the data value as it was returned by the REST API.
|
public StreamingEvent(com.google.gson.Gson gson,
StreamingEvent.EventType eventType,
java.lang.String eventData)
public StreamingEvent.EventType getEventType()
StreamingEvent.EventType for the individual event. Note that some types have been
renamed to match the corresponding FirebaseRestReference interface
better.StreamingEvent.EventTypepublic java.lang.String getSerialzedEventData()
public StreamingEventData getEventData()
StreamingEventData without additional type context information. This means that
Gson will make a best effort to deserialize the response. As a result, all complex types will be represented
as Map<String, Object> and Integer values will be returned as Double.StreamingEventData object containing the relative path and the value of the event.public <T> StreamingEventData<T> getEventData(com.google.gson.reflect.TypeToken<StreamingEventData<T>> typeToken)
StreamingEventData without additional type context information. This means that
Gson will make a best effort to deserialize the response. As a result, all complex types will be represented
as Map<String, Object> and Integer values will be returned as Double.T - The type of the actual data node.typeToken - The TypeToken representing the StreamingEventData type of the data property
of the event response, including the type parameter.StreamingEventData object containing the relative path and the value of the event.