Class EthosRequestConverter<T>
- java.lang.Object
-
- com.ellucian.ethos.integration.client.EthosRequestConverter<T>
-
- Type Parameters:
T
- The generic type to convert from.
public class EthosRequestConverter<T> extends Object
Converts request body generic type objects into JSON formatted strings, for use when making POST or PUT API requests.
-
-
Constructor Summary
Constructors Constructor Description EthosRequestConverter()
No-arg constructor which also builds the objectMapper.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
toJsonString(T genericType)
Converts the given generic object type to a JSON formatted string.
-
-
-
Method Detail
-
toJsonString
public String toJsonString(T genericType) throws com.fasterxml.jackson.core.JsonProcessingException
Converts the given generic object type to a JSON formatted string. Intended to be used for converting a generic object type of a request body into a JSON formatted string.- Parameters:
genericType
- The generic object type of the request body to convert.- Returns:
- A JSON formatted request body string representing the given generic object type, or null of the genericType is null.
- Throws:
com.fasterxml.jackson.core.JsonProcessingException
- Thrown if the objectMapper cannot write the generic type as a string.
-
-