com.heroku.api.parser
public class Json extends Object
Constructor and Description |
---|
Json() |
Modifier and Type | Method and Description |
---|---|
static <T> T |
parse(byte[] data,
Class<? extends Request<T>> classType)
Calls Parser.parse() using the generic type T for Request
|
static <T> T |
parse(byte[] data,
Type type)
Proxy method for getting the Parser and calling parse().
|
public static <T> T parse(byte[] data, Type type)
T
- Deserialzed object typedata
- JSON byte array to be parsed.type
- Deserialized type for the JSON datapublic static <T> T parse(byte[] data, Class<? extends Request<T>> classType)
public class SampleRequest implements Request {
...
public App getResponse(byte[] data, int status) {
return Json.parse(data, getClass());
}
}
data
- JSON byte array to be parsedclassType
- The Request implementation class type. This is typically given the calling class as
an argument.Copyright © 2014. All Rights Reserved.