2.9.3 (latest) 2.9.2 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

```java
public abstract class TypedNotificationCallback<T> implements UnparsedNotificationCallback
```
Beta   

Callback to receive notifications for watched resource in which the . Callback which is used to
receive typed [AbstractNotification](https://docs.cloud.google.com/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.notifications.AbstractNotification.md.txt)s after subscribing to a topic.

Must NOT be implemented in form of an anonymous class as this will break serialization.

Implementation should be thread-safe. **Example usage:**

```java

 static class MyNotificationCallback
     extends JsonNotificationCallback{@literal <}listresponse{@literal>} {

   private static final long serialVersionUID = 1L;

   {@literal @}Override
   protected void onNotification
       (StoredChannel subscription, Notification notification, ListResponse content) {
     switch (notification.getResourceState()) {
       case ResourceStates.SYNC:
         break;
       case ResourceStates.EXISTS:
         break;
       case ResourceStates.NOT_EXISTS:
         break;
     }
   }

    {@literal @}Override
    protected ObjectParser getObjectParser(Notification notification) throws IOException {
      return new JsonObjectParser(new GsonFactory());
    }

    {@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\>

## Implements

[UnparsedNotificationCallback](https://docs.cloud.google.com/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.notifications.UnparsedNotificationCallback.md.txt)

## Inherited Members

[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

### TypedNotificationCallback()

```java
public TypedNotificationCallback()
```

## Methods

### getDataClass()

```java
protected abstract Class<T> getDataClass()
```
Returns the data class to parse the notification content into or `Void.class` if no
notification content is expected.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Class<T>` |   |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `IOException` |   |

### getObjectParser()

```java
protected abstract ObjectParser getObjectParser()
```
Returns an ObjectParser which can be used to parse this notification.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.api.client.util.ObjectParser` |   |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `IOException` |   |

### onNotification(StoredChannel storedChannel, TypedNotification\<T\> notification)

```java
protected abstract void onNotification(StoredChannel storedChannel, TypedNotification<T> notification)
```
Handles a received typed notification.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `storedChannel` | `StoredChannel` stored notification channel |
| `notification` | `TypedNotification<T>` typed notification |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `IOException` |   |

### onNotification(StoredChannel storedChannel, UnparsedNotification notification)

```java
public final void onNotification(StoredChannel storedChannel, UnparsedNotification notification)
```
Handles a received unparsed notification.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `storedChannel` | `StoredChannel` |
| `notification` | `UnparsedNotification` |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `IOException` |   |