T - Type of the data contained within a notification@Beta public abstract class JacksonNotificationCallback<T> extends JsonNotificationCallback<T>
Beta TypedNotificationCallback which uses an JSON content encoding with
JacksonFactory.getDefaultInstance().
Must NOT be implemented in form of an anonymous class as this will break serialization.
Implementation should be thread-safe.
Example usage:
static class MyNotificationCallback
extends GsonNotificationCallback <ListResponse > {
private static final long serialVersionUID = 1L;
@Override
protected void onNotification(
StoredChannel channel, TypedNotification <ListResponse > notification) {
ListResponse content = notification.getContent();
switch (notification.getResourceState()) {
case ResourceStates.SYNC:
break;
case ResourceStates.EXISTS:
break;
case ResourceStates.NOT_EXISTS:
break;
}
}
@Override
protected Class <ListResponse > getDataClass() throws IOException {
return ListResponse.class;
}
}
| Constructor and Description |
|---|
JacksonNotificationCallback() |
| Modifier and Type | Method and Description |
|---|---|
protected com.google.api.client.json.JsonFactory |
getJsonFactory() |
getObjectParsergetDataClass, onNotification, onNotificationprotected com.google.api.client.json.JsonFactory getJsonFactory()
getJsonFactory in class JsonNotificationCallback<T>Copyright © 2010–2019 Google. All rights reserved.