T - Data content from the underlying response stored within this notificationpublic final class TypedNotification<T> extends Notification
Thread-safe implementation.
Example usage:
void handleNotification(
Subscription subscription, TypedNotification<ItemList> notification) {
for (Item item : notification.getContent().getItems()) {
System.out.println(item.getId());
}
}
| Constructor and Description |
|---|
TypedNotification(Notification notification,
T content) |
TypedNotification(String subscriptionId,
String topicId,
String topicURI,
String clientToken,
long messageNumber,
String eventType,
String changeType,
T content) |
| Modifier and Type | Method and Description |
|---|---|
T |
getContent()
Returns the typed content or
null for none. |
getChangeType, getClientToken, getEventType, getMessageNumber, getSubscriptionId, getTopicId, getTopicURIpublic TypedNotification(Notification notification, T content)
notification - notification whose information is copiedcontent - typed content or null for nonepublic TypedNotification(String subscriptionId, String topicId, String topicURI, String clientToken, long messageNumber, String eventType, String changeType, T content)
subscriptionId - subscription UUIDtopicId - opaque ID for the subscribed resource that is stable across API versionstopicURI - opaque ID (in the form of a canonicalized URI) for the subscribed resource that
is sensitive to the API versionclientToken - client token (an opaque string) or null for nonemessageNumber - message number (a monotonically increasing value starting with 1)eventType - event type (see EventTypes)changeType - type of change performed on the resource or null for nonecontent - typed content or null for nonepublic final T getContent()
null for none.Copyright © 2010-2012 Google. All Rights Reserved.