All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.urbanairship.api.common.parse.SetOfStringsDeserializer Maven / Gradle / Ivy

There is a newer version: 9.7.0
Show newest version
/*
 * Copyright 2013 Urban Airship and Contributors
 */

package com.urbanairship.api.common.parse;

import org.codehaus.jackson.JsonParser;
import org.codehaus.jackson.type.TypeReference;

import java.io.IOException;
import java.util.Set;

public class SetOfStringsDeserializer {

    public static final SetOfStringsDeserializer INSTANCE = new SetOfStringsDeserializer();

    private SetOfStringsDeserializer() { }

    public Set deserialize(JsonParser parser, String fieldName) {
        try {
            return parser.readValueAs(new TypeReference>() {});
        }
        catch (IOException e) {
            throw new APIParsingException(String.format("%s must be an array of simple strings", fieldName));
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy