Class JsonParser<T>
java.lang.Object
com.suse.salt.netapi.parser.JsonParser<T>
- Type Parameters:
T- The result type this parser produces.
Parser for Salt API responses.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final JsonParser<Event> private final com.google.gson.Gsonstatic final com.google.gson.Gsonstatic final JsonParser<Map<String, Object>> static final JsonParser<Return<List<Map<String, Result<SSHRawResult>>>>> static final JsonParser<Stats> static final JsonParser<Return<String>> static final JsonParser<Return<List<Token>>> private final com.google.gson.reflect.TypeToken<T> -
Constructor Summary
ConstructorsConstructorDescriptionJsonParser(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 Summary
-
Field Details
-
GSON
public static final com.google.gson.Gson GSON -
STRING
-
TOKEN
-
RUN_RESULTS
-
RUNSSHRAW_RESULTS
-
STATS
-
MAP
-
EVENTS
-
type
-
gson
private final com.google.gson.Gson gson
-
-
Constructor Details
-
JsonParser
Created a new JsonParser for the given type.- Parameters:
type- A TypeToken describing the type this parser produces.
-
JsonParser
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 Details
-
parse
Parses a Json response that has a direct representation as a Java class.- Parameters:
inputStream- result stream to parse.- Returns:
- The parsed value.
-
parse
-