com.urbanairship.api.nameduser.parse.NamedUserViewReader 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.nameduser.parse;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.urbanairship.api.channel.model.ChannelView;
import com.urbanairship.api.common.parse.APIParsingException;
import com.urbanairship.api.common.parse.JsonObjectReader;
import com.urbanairship.api.common.parse.StringFieldDeserializer;
import com.urbanairship.api.nameduser.model.NamedUserView;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
public class NamedUserViewReader implements JsonObjectReader {
ObjectMapper mapper = NamedUserObjectMapper.getInstance();
private NamedUserView.Builder builder;
public NamedUserViewReader() {
builder = NamedUserView.newBuilder();
}
public void readNamedUserId(JsonParser jsonParser) throws IOException {
builder.setNamedUserId(StringFieldDeserializer.INSTANCE.deserialize(jsonParser, "named_user_id"));
}
public void readNamedUserTags(JsonParser jsonParser) throws IOException {
Map> mutableTags = jsonParser.readValueAs(new TypeReference
© 2015 - 2024 Weber Informatics LLC | Privacy Policy