Interface ObjectMapperFactory
- All Known Implementing Classes:
DefaultObjectMapperFactory
,GuiceObjectMapperFactory
public interface ObjectMapperFactory
A factory to produce
ObjectMapper
instances-
Method Summary
Modifier and Type Method Description default <T> @NonNull ObjectMapper<T>
getMapper(@NonNull TypeToken<T> type)
Creates anObjectMapper
for the given type.<T> @NonNull ObjectMapper<T>
getMapper(@NonNull Class<T> type)
Creates anObjectMapper
for the given type.
-
Method Details
-
getMapper
Creates anObjectMapper
for the given type.- Type Parameters:
T
- The type- Parameters:
type
- The type- Returns:
- An object mapper
- Throws:
ObjectMappingException
- If an exception occured whilst mapping
-
getMapper
default <T> @NonNull ObjectMapper<T> getMapper(@NonNull TypeToken<T> type) throws ObjectMappingExceptionCreates anObjectMapper
for the given type.- Type Parameters:
T
- The type- Parameters:
type
- The type- Returns:
- An object mapper
- Throws:
ObjectMappingException
- If an exception occured whilst mapping
-