Modifier | Constructor and Description |
---|---|
protected |
ListMapper(Class<? extends Mapper<T>> elementMapperType,
Mapper<T> elementMapper) |
Modifier and Type | Method and Description |
---|---|
static <T> ListMapper<T> |
create(Class<? extends Mapper<T>> elementMapperType) |
static <T> ListMapper<T> |
create(Mapper<T> elementMapper) |
List<T> |
fromDb(Object dbValue)
Transform a database value to a typed Java object.
|
Mapper<T> |
getElementMapper() |
protected void |
initialize(MapperRegistry registry)
Initialize the database mappers.
|
List<Object> |
toDb(List<T> value)
Transform a typed Java object into its database representation.
|
@Nonnull public static <T> ListMapper<T> create(@Nonnull Class<? extends Mapper<T>> elementMapperType)
@Nonnull public static <T> ListMapper<T> create(@Nonnull Mapper<T> elementMapper)
public List<T> fromDb(@Nullable Object dbValue) throws MapperException
Mapper
fromDb
in class Mapper<List<T>>
dbValue
- Database value to be transformed.MapperException
- Thrown if the database value could not be transformed to a Java object.@Nullable public List<Object> toDb(@Nullable List<T> value) throws MapperException
Mapper
toDb
in class Mapper<List<T>>
value
- Value to transform.MapperException
- Thrown if the value could not be mapped.protected void initialize(@Nonnull MapperRegistry registry) throws SchemaException
Mapper
initialize
in class Mapper<List<T>>
registry
- Registry with all mappers.SchemaException
- Thrown if an error is encountered in one of the mappers. This prevents the system from
booting with an incorrect mapper configuration.Copyright © 2018 TomTom International BV. All rights reserved.