use of com.ibm.watson.developer_cloud.assistant.v1.model.LogPagination in project java-sdk by watson-developer-cloud.
the class LogPaginationTypeAdapter method read.
/*
* (non-Javadoc)
* @see com.google.gson.TypeAdapter#read(com.google.gson.stream.JsonReader)
*/
@Override
public LogPagination read(JsonReader reader) throws IOException {
if (reader.peek() == JsonToken.NULL) {
reader.nextNull();
return null;
}
reader.beginObject();
LogPagination pagination = new LogPagination();
while (reader.hasNext()) {
String name = reader.nextName();
if (name.equals(NEXT_URL)) {
String nextUrl = reader.nextString();
HttpUrl url = HttpUrl.parse(DEFAULT_ENDPOINT + nextUrl);
pagination.setCursor(url.queryParameter(CURSOR));
pagination.setNextUrl(nextUrl);
} else if (name.equals(MATCHED)) {
pagination.setMatched(reader.nextLong());
} else {
reader.skipValue();
}
}
reader.endObject();
return pagination;
}
use of com.ibm.watson.developer_cloud.assistant.v1.model.LogPagination in project java-sdk by watson-developer-cloud.
the class LogPaginationTypeAdapter method read.
/*
* (non-Javadoc)
* @see com.google.gson.TypeAdapter#read(com.google.gson.stream.JsonReader)
*/
@Override
public LogPagination read(JsonReader reader) throws IOException {
if (reader.peek() == JsonToken.NULL) {
reader.nextNull();
return null;
}
reader.beginObject();
LogPagination pagination = new LogPagination();
while (reader.hasNext()) {
String name = reader.nextName();
if (name.equals(NEXT_URL)) {
String nextUrl = reader.nextString();
HttpUrl url = HttpUrl.parse(DEFAULT_ENDPOINT + nextUrl);
pagination.setCursor(url.queryParameter(CURSOR));
pagination.setNextUrl(nextUrl);
} else if (name.equals(MATCHED)) {
pagination.setMatched(reader.nextLong());
} else {
reader.skipValue();
}
}
reader.endObject();
return pagination;
}
Aggregations