Package com.microsoft.graph.serializer
Interface ISerializer
- All Known Implementing Classes:
DefaultSerializer
public interface ISerializer
Serializes and deserializes items from strings into their types
-
Method Summary
Modifier and TypeMethodDescriptiondefault <T> TdeserializeObject(com.google.gson.JsonElement jsonElement, Class<T> clazz) Deserialize an object from the input JsonElement<T> TdeserializeObject(com.google.gson.JsonElement jsonElement, Class<T> clazz, Map<String, List<String>> responseHeaders) Deserialize an object from the input JsonElementdefault <T> TdeserializeObject(InputStream inputStream, Class<T> clazz) Deserialize an object from the input stream<T> TdeserializeObject(InputStream inputStream, Class<T> clazz, Map<String, List<String>> responseHeaders) Deserialize an object from the input streamdefault <T> TdeserializeObject(String inputString, Class<T> clazz) Deserialize an object from the input string<T> TDeserialize an object from the input string<T> StringserializeObject(T serializableObject) Serializes an object into a string
-
Method Details
-
deserializeObject
Deserialize an object from the input string- Type Parameters:
T- the type of the item to be deserialized- Parameters:
inputString- the string that stores the representation of the itemclazz- theClassof the item to be deserialized- Returns:
- the deserialized item from the input string
-
deserializeObject
@Nullable <T> T deserializeObject(@Nonnull String inputString, @Nonnull Class<T> clazz, @Nullable Map<String, List<String>> responseHeaders) Deserialize an object from the input string- Type Parameters:
T- the type of the item to be deserialized- Parameters:
inputString- the string that stores the representation of the itemclazz- theClassof the item to be deserializedresponseHeaders- the HTTP response headers- Returns:
- the deserialized item from the input string
-
deserializeObject
@Nullable default <T> T deserializeObject(@Nonnull InputStream inputStream, @Nonnull Class<T> clazz) Deserialize an object from the input stream- Type Parameters:
T- the type of the item to be deserialized- Parameters:
inputStream- the stream that stores the representation of the itemclazz- theClassof the item to be deserialized- Returns:
- the deserialized item from the input string
-
deserializeObject
@Nullable <T> T deserializeObject(@Nonnull InputStream inputStream, @Nonnull Class<T> clazz, @Nullable Map<String, List<String>> responseHeaders) Deserialize an object from the input stream- Type Parameters:
T- the type of the item to be deserialized- Parameters:
inputStream- the stream that stores the representation of the itemclazz- theClassof the item to be deserializedresponseHeaders- the HTTP response headers- Returns:
- the deserialized item from the input string
-
deserializeObject
@Nullable default <T> T deserializeObject(@Nonnull com.google.gson.JsonElement jsonElement, @Nonnull Class<T> clazz) Deserialize an object from the input JsonElement- Type Parameters:
T- the type of the item to be deserialized- Parameters:
jsonElement- theJsonElementthat stores the representation of the itemclazz- theClassof the item to be deserialized- Returns:
- the deserialized item from the input string
-
deserializeObject
@Nullable <T> T deserializeObject(@Nonnull com.google.gson.JsonElement jsonElement, @Nonnull Class<T> clazz, @Nullable Map<String, List<String>> responseHeaders) Deserialize an object from the input JsonElement- Type Parameters:
T- the type of the item to be deserialized- Parameters:
jsonElement- theJsonElementthat stores the representation of the itemclazz- theClassof the item to be deserializedresponseHeaders- the HTTP response headers- Returns:
- the deserialized item from the input string
-
serializeObject
Serializes an object into a string- Type Parameters:
T- the type of the item to be serialized- Parameters:
serializableObject- the object to convert into a string- Returns:
- the string representation of that item
-