com.urbanairship.api.push.parse.InAppReader 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
package com.urbanairship.api.push.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.parse.APIParsingException;
import com.urbanairship.api.common.parse.JsonObjectReader;
import com.urbanairship.api.push.model.Display;
import com.urbanairship.api.push.model.InApp;
import com.urbanairship.api.push.model.PushExpiry;
import com.urbanairship.api.push.model.notification.Interactive;
import com.urbanairship.api.push.model.notification.actions.Actions;
import java.io.IOException;
import java.util.Map;
public class InAppReader implements JsonObjectReader {
private final InApp.Builder builder;
public InAppReader() {
this.builder = InApp.newBuilder();
}
public void readAlert(JsonParser parser) throws IOException {
builder.setAlert(parser.readValueAs(String.class));
}
public void readExpiry(JsonParser parser) throws IOException {
builder.setExpiry(parser.readValueAs(PushExpiry.class));
}
public void readDisplay(JsonParser parser) throws IOException {
builder.setDisplay(parser.readValueAs(Display.class));
}
public void readActions(JsonParser parser) throws IOException {
builder.setActions(parser.readValueAs(Actions.class));
}
public void readInteractive(JsonParser parser) throws IOException {
builder.setInteractive(parser.readValueAs(Interactive.class));
}
public void readAllExtras(JsonParser parser) throws IOException {
Map mutableExtras = parser.readValueAs(new TypeReference
© 2015 - 2024 Weber Informatics LLC | Privacy Policy