Package io.hanko.sdk.json
Class HankoJsonParser
java.lang.Object
io.hanko.sdk.json.HankoJsonParser
Custom Json parser used for serializing Hanko API payloads and deserializing Hanko API responses.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> Tdeserialize(File f, Class<T> valueType)Deserialize Filefinto object of typeT.<T> Tdeserialize(InputStream is, Class<T> valueType)Deserialize InputStreamisinto object of typeT.<T> Tdeserialize(String s, Class<T> valueType)Deserialize Stringsinto object of typeT.<T> List<T>deserializeList(InputStream is, Class<T> valueType)Deserialize InputStreamisinto a list of objects of typeT.<T> Stringserialize(T value)Serialize instance of typeTto a String.
-
Constructor Details
-
HankoJsonParser
public HankoJsonParser()Construct a HankoJsonParser.
-
-
Method Details
-
deserialize
Deserialize InputStreamisinto object of typeT.- Type Parameters:
T- the type to deserialize data into- Parameters:
is- the InputStreamvalueType- theClassfor typeT- Returns:
- an instance of
T - Throws:
HankoClientException- if any error during deserialization occurs
-
deserialize
Deserialize Stringsinto object of typeT.- Type Parameters:
T- the type to deserialize data into- Parameters:
s- the StringvalueType- theClassfor typeT- Returns:
- an instance of
T - Throws:
HankoClientException- if any error during deserialization occurs
-
deserialize
Deserialize Filefinto object of typeT.- Type Parameters:
T- the type to deserialize data into- Parameters:
f- the FilevalueType- theClassfor typeT- Returns:
- an instance of
T - Throws:
HankoClientException- if any error during deserialization occurs
-
deserializeList
Deserialize InputStreamisinto a list of objects of typeT.- Type Parameters:
T- the type to deserialize data into- Parameters:
is- the InputStreamvalueType- theClassfor typeT- Returns:
- an instance of
T - Throws:
HankoClientException- if any error during deserialization occurs
-
serialize
Serialize instance of typeTto a String.- Type Parameters:
T- the type to serialize- Parameters:
value- an instance of typeT- Returns:
- the serialized String
- Throws:
HankoClientException- if any error during serialization occurs
-