public class PreResponseDeserializer extends Object
Sample serialized PreResponse string
{
"responseContext": "[
"com.yahoo.bard.webservice.web.responseprocessors.ResponseContext",
{
"randomHeader": "someHeader",
"missingIntervals": ["java.util.ArrayList",
["a","b", "c",
["java.util.ArrayList",
[
[
"org.joda.time.Interval",
"2011-02-02T07:00:00.000Z/2011-02-03T10:15:00.000Z"
]
]
],
[
"java.math.BigDecimal",100
]
]
]
}
]",
"resultSet": {
"results": [
{
"dimensionRows": {
"ageBracket": "1",
"country": "US",
"gender": "m"
},
"metricsRows": {
"lookbackPageViews": 112,
"retentionPageViews": 113,
"simplePageViews": 111
},
"timeStamp": "2016-01-12T00:00:00.000Z"
},
{
"dimensionRows": {
"ageBracket": "4",
"country": "IN",
"gender": "f"
},
"metricsRows": {
"lookbackPageViews": 212,
"retentionPageViews": 213,
"simplePageViews": 211
},
"timeStamp": "2016-01-12T00:00:00.000Z"
}
],
"schema": {
"dimensionColumns": [
"ageBracket",
"country",
"gender"
],
"granularity": "day",
"metricColumns": [
"lookbackPageViews",
"simplePageViews",
"retentionPageViews"
],
"metricColumnsType": {
"lookbackPageViews": "java.math.BigDecimal",
"retentionPageViews": "java.math.BigDecimal",
"simplePageViews": "java.math.BigDecimal"
},
"timeZone": "UTC"
}
}
}
Modifier and Type | Field and Description |
---|---|
static SystemConfig |
SYSTEM_CONFIG |
Constructor and Description |
---|
PreResponseDeserializer(DimensionDictionary dimensionDictionary,
com.fasterxml.jackson.databind.ObjectMapper nonResponseContextMapper,
com.fasterxml.jackson.databind.ObjectMapper responseContextMapper,
GranularityParser granularityParser)
Class constructor.
|
Modifier and Type | Method and Description |
---|---|
PreResponse |
deserialize(String preResponse)
Deserialize the custom serialized PreResponse.
|
DimensionDictionary |
getDimensionDictionary() |
GranularityParser |
getGranularityParser() |
com.fasterxml.jackson.databind.ObjectMapper |
getNonResponseContextMapper() |
com.fasterxml.jackson.databind.ObjectMapper |
getResponseContextMapper() |
public static final SystemConfig SYSTEM_CONFIG
public PreResponseDeserializer(DimensionDictionary dimensionDictionary, com.fasterxml.jackson.databind.ObjectMapper nonResponseContextMapper, com.fasterxml.jackson.databind.ObjectMapper responseContextMapper, GranularityParser granularityParser)
dimensionDictionary
- DimensionDictionary which contains all the details about dimensionsnonResponseContextMapper
- Handles the deserialization of everything except the response contextresponseContextMapper
- Handles the deserialization of the response context of the PreResponsegranularityParser
- Time grain providerpublic PreResponse deserialize(String preResponse) throws IOException
preResponse
- Custom serialized PreResponseIOException
- in case of deserialization of ResponseContext failspublic DimensionDictionary getDimensionDictionary()
public com.fasterxml.jackson.databind.ObjectMapper getNonResponseContextMapper()
public com.fasterxml.jackson.databind.ObjectMapper getResponseContextMapper()
public GranularityParser getGranularityParser()
Copyright © 2016–2018 Yahoo! Inc.. All rights reserved.