Interface ObjectMapper
- All Known Implementing Classes:
GsonObjectMapper, JacksonObjectMapper
public interface ObjectMapper
Interface for object mappers that can transform response bodies to other structures.
-
Method Summary
Modifier and TypeMethodDescription<T> Treads the content from the request as a string and transforms to a type passed by the asObject method on the Unirest builder.default <T> TreadValue(String value, GenericType<T> genericType) reads the content from the request as a string and transforms to a type passed by the asObject method on the Unirest builder.writeValue(Object value) Takes a object and serialize it as a string.
-
Method Details
-
readValue
reads the content from the request as a string and transforms to a type passed by the asObject method on the Unirest builder.- Type Parameters:
T- the type- Parameters:
value- the content as a string.valueType- the type to map to- Returns:
- the object mapped into the class type
-
readValue
reads the content from the request as a string and transforms to a type passed by the asObject method on the Unirest builder. This method takes a GenericType which retains Generics information for types lke List<Foo>- Type Parameters:
T- the type- Parameters:
value- the content as a string.genericType- the generic type- Returns:
- the object mapped into the class type
-
writeValue
-