com.urbanairship.api.staticlists.parse.StaticListViewReader Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-client Show documentation
Show all versions of java-client Show documentation
The Urban Airship Java client library
/*
* Copyright (c) 2013-2016. Urban Airship and Contributors
*/
package com.urbanairship.api.staticlists.parse;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.type.TypeReference;
import com.google.common.collect.ImmutableMap;
import com.urbanairship.api.common.model.ErrorDetails;
import com.urbanairship.api.common.parse.APIParsingException;
import com.urbanairship.api.common.parse.JsonObjectReader;
import com.urbanairship.api.staticlists.model.StaticListView;
import org.joda.time.DateTime;
import java.io.IOException;
import java.util.Map;
public class StaticListViewReader implements JsonObjectReader {
private final StaticListView.Builder builder;
public StaticListViewReader() {
this.builder = StaticListView.newBuilder();
}
public void readOk(JsonParser jsonParser) throws IOException {
builder.setOk(jsonParser.readValueAs(Boolean.class));
}
public void readName(JsonParser jsonParser) throws IOException {
builder.setName(jsonParser.readValueAs(String.class));
}
public void readDescription(JsonParser jsonParser) throws IOException {
builder.setDescription(jsonParser.readValueAs(String.class));
}
public void readExtras(JsonParser jsonParser) throws IOException {
Map mutableExtras = jsonParser.readValueAs(new TypeReference
© 2015 - 2024 Weber Informatics LLC | Privacy Policy