2.9.1 (latest) 2.9.0 2.8.1 2.7.2 2.6.0 2.5.1 2.4.1 2.1.2 2.0.1 1.35.2 1.34.1 1.33.4

    public abstract class GsonNotificationCallback<T> extends JsonNotificationCallback<T>

Beta   

A [TypedNotificationCallback](https://docs.cloud.google.com/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.notifications.TypedNotificationCallback) which uses a JSON content encoding with GsonFactory#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{@literal <}listresponse{@literal>} {

       private static final long serialVersionUID = 1L;

       {@literal @}Override
       protected void onNotification(StoredChannel channel,
           TypedNotification{@literal <}listresponse{@literal>} notification) {
         ListResponse content = notification.getContent();
         switch (notification.getResourceState()) {
           case ResourceStates.SYNC:
             break;
           case ResourceStates.EXISTS:
             break;
           case ResourceStates.NOT_EXISTS:
             break;
         }
       }

       {@literal @}Override
       protected Class{@literal <}listresponse{@literal>} getDataClass() throws IOException {
         return ListResponse.class;
       }
     }
     
## Inheritance

[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \> [TypedNotificationCallback\<T\>](https://docs.cloud.google.com/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.notifications.TypedNotificationCallback) \> [JsonNotificationCallback](https://docs.cloud.google.com/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.notifications.json.JsonNotificationCallback) \> GsonNotificationCallback\<T\>

## Inherited Members

[TypedNotificationCallback.getDataClass()](https://docs.cloud.google.com/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.notifications.TypedNotificationCallback#com_google_api_client_googleapis_notifications_TypedNotificationCallback_getDataClass__) [TypedNotificationCallback.onNotification(StoredChannel,TypedNotification\<T\>)](https://docs.cloud.google.com/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.notifications.TypedNotificationCallback#com_google_api_client_googleapis_notifications_TypedNotificationCallback_onNotification_com_google_api_client_googleapis_notifications_StoredChannel_com_google_api_client_googleapis_notifications_TypedNotification_T__) [TypedNotificationCallback.onNotification(StoredChannel,UnparsedNotification)](https://docs.cloud.google.com/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.notifications.TypedNotificationCallback#com_google_api_client_googleapis_notifications_TypedNotificationCallback_onNotification_com_google_api_client_googleapis_notifications_StoredChannel_com_google_api_client_googleapis_notifications_UnparsedNotification_) [JsonNotificationCallback.getJsonFactory()](https://docs.cloud.google.com/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.notifications.json.JsonNotificationCallback#com_google_api_client_googleapis_notifications_json_JsonNotificationCallback_getJsonFactory__) [JsonNotificationCallback.getObjectParser()](https://docs.cloud.google.com/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.notifications.json.JsonNotificationCallback#com_google_api_client_googleapis_notifications_json_JsonNotificationCallback_getObjectParser__) [Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) [Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) [Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) [Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) [Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) [Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) [Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) [Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) [Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) [Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) [Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)

| ## Type Parameter ||
|---|---|
| **Name** | **Description** |
| `T` |   |

## Constructors

### GsonNotificationCallback()

    public GsonNotificationCallback()

## Methods

### getJsonFactory()

    protected JsonFactory getJsonFactory()

Returns the JSON factory to use to parse the notification content.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.api.client.json.JsonFactory` |   |

**Overrides** [JsonNotificationCallback\<T\>.getJsonFactory()](https://docs.cloud.google.com/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.notifications.json.JsonNotificationCallback#com_google_api_client_googleapis_notifications_json_JsonNotificationCallback_getJsonFactory__)