com.urbanairship.api.reports.parse.PerPushCountsReader 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.reports.parse;
import com.urbanairship.api.common.parse.APIParsingException;
import com.urbanairship.api.common.parse.JsonObjectReader;
import com.urbanairship.api.reports.model.PerPushCounts;
import org.codehaus.jackson.JsonParser;
import java.io.IOException;
public final class PerPushCountsReader implements JsonObjectReader {
private final PerPushCounts.Builder builder;
public PerPushCountsReader() {
this.builder = PerPushCounts.newBuilder();
}
public void readDirectResponses(JsonParser jsonParser) throws IOException {
builder.setDirectResponses(jsonParser.readValueAs(long.class));
}
public void readInfluencedResponses(JsonParser jsonParser) throws IOException {
builder.setInfluencedResponses(jsonParser.readValueAs(long.class));
}
public void readSends(JsonParser jsonParser) throws IOException {
builder.setSends(jsonParser.readValueAs(long.class));
}
@Override
public PerPushCounts validateAndBuild() throws IOException {
try {
return builder.build();
} catch (Exception e) {
throw new APIParsingException(e.getMessage());
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy