public class Watch<T> extends Object implements Iterable<Watch.Response<T>>, Iterator<Watch.Response<T>>
| Modifier and Type | Class and Description |
|---|---|
static class |
Watch.Response<T>
Response class holds a watch response that has a `type` that can be
ADDED, MODIFIED, DELETED and ERROR.
|
| Modifier and Type | Method and Description |
|---|---|
static <T> Watch<T> |
createWatch(ApiClient client,
com.squareup.okhttp.Call call,
Type watchType)
Creates a watch on a TYPENAME (T) using an API Client and a Call object.
|
boolean |
hasNext() |
Iterator<Watch.Response<T>> |
iterator() |
Watch.Response<T> |
next() |
void |
remove() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorforEachRemainingpublic static <T> Watch<T> createWatch(ApiClient client, com.squareup.okhttp.Call call, Type watchType) throws ApiException
T - TYPENAME.client - the API clientcall - the call object returned by api.{ListOperation}Call(...)
method. Make sure watch flag is set in the call.watchType - The type of the WatchResponse<T>. Use something like
new TypeToken<Watch.Response<TYPENAME>>(){}.getType()ApiException - on IO exceptions.public Watch.Response<T> next()
next in interface Iterator<Watch.Response<T>>public boolean hasNext()
hasNext in interface Iterator<Watch.Response<T>>public Iterator<Watch.Response<T>> iterator()
iterator in interface Iterable<Watch.Response<T>>public void remove()
remove in interface Iterator<Watch.Response<T>>Copyright © 2017. All rights reserved.