com.urbanairship.api.common.parse.ListOfStringsDeserializer 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.common.parse;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.type.TypeReference;
import java.io.IOException;
import java.util.List;
public class ListOfStringsDeserializer {
public static final ListOfStringsDeserializer INSTANCE = new ListOfStringsDeserializer();
private ListOfStringsDeserializer() { }
public List 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 - 2024 Weber Informatics LLC | Privacy Policy