Package com.suse.salt.netapi.parser
Class JsonParser<T>
- java.lang.Object
- 
- com.suse.salt.netapi.parser.JsonParser<T>
 
- 
- Type Parameters:
- T- The result type this parser produces.
 
 public class JsonParser<T> extends Object Parser for Salt API responses.
- 
- 
Field SummaryFields Modifier and Type Field Description static JsonParser<Event>EVENTSstatic com.google.gson.GsonGSONstatic JsonParser<Map<String,Object>>MAPstatic JsonParser<Return<List<Map<String,Object>>>>RUN_RESULTSstatic JsonParser<Return<List<Map<String,Result<SSHRawResult>>>>>RUNSSHRAW_RESULTSstatic JsonParser<Stats>STATSstatic JsonParser<Return<String>>STRINGstatic JsonParser<Return<List<Token>>>TOKEN
 - 
Constructor SummaryConstructors Constructor Description JsonParser(com.google.gson.reflect.TypeToken<T> type)Created a new JsonParser for the given type.JsonParser(com.google.gson.reflect.TypeToken<T> type, com.google.gson.Gson gson)Created a new JsonParser for the given type.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description Tparse(InputStream inputStream)Parses a Json response that has a direct representation as a Java class.Tparse(String jsonString)Parse JSON given as string.
 
- 
- 
- 
Field Detail- 
GSONpublic static final com.google.gson.Gson GSON 
 - 
STRINGpublic static final JsonParser<Return<String>> STRING 
 - 
TOKENpublic static final JsonParser<Return<List<Token>>> TOKEN 
 - 
RUNSSHRAW_RESULTSpublic static final JsonParser<Return<List<Map<String,Result<SSHRawResult>>>>> RUNSSHRAW_RESULTS 
 - 
STATSpublic static final JsonParser<Stats> STATS 
 - 
MAPpublic static final JsonParser<Map<String,Object>> MAP 
 - 
EVENTSpublic static final JsonParser<Event> EVENTS 
 
- 
 - 
Constructor Detail- 
JsonParserpublic JsonParser(com.google.gson.reflect.TypeToken<T> type) Created a new JsonParser for the given type.- Parameters:
- type- A TypeToken describing the type this parser produces.
 
 - 
JsonParserpublic JsonParser(com.google.gson.reflect.TypeToken<T> type, com.google.gson.Gson gson) Created a new JsonParser for the given type.- Parameters:
- type- A TypeToken describing the type this parser produces.
- gson- Gson instance to use for parsing.
 
 
- 
 - 
Method Detail- 
parsepublic T parse(InputStream inputStream) Parses a Json response that has a direct representation as a Java class.- Parameters:
- inputStream- result stream to parse.
- Returns:
- The parsed value.
 
 
- 
 
-