public class DynamicSetRowMapper<ROW,SET,T,E extends Exception,K extends FieldKey<K>> extends Object implements SetRowMapper<ROW,SET,T,E>
| Constructor and Description |
|---|
DynamicSetRowMapper(org.simpleflatmapper.util.UnaryFactory<MapperKey<K>,SetRowMapper<ROW,SET,T,E>> mapperFactory,
org.simpleflatmapper.util.UnaryFactoryWithException<ROW,MapperKey<K>,E> mapperKeyFromRow,
org.simpleflatmapper.util.UnaryFactoryWithException<SET,MapperKey<K>,E> mapperKeyFromSet,
MapperKeyComparator<K> keyComparator) |
| Modifier and Type | Method and Description |
|---|---|
org.simpleflatmapper.util.Enumerable<T> |
enumerate(SET source) |
<H extends org.simpleflatmapper.util.CheckedConsumer<? super T>> |
forEach(SET set,
H handler)
Loop over the resultSet, map each row to a new newInstance of T and call back the handler
|
SetRowMapper<ROW,SET,T,E> |
getMapper(MapperKey<K> key) |
Iterator<T> |
iterator(SET rs) |
T |
map(ROW row)
map the current row of source object to a new newInstance of T.
|
T |
map(ROW row,
MappingContext<? super ROW> context)
map the current row of source object to a new newInstance of T.
|
Stream<T> |
stream(SET set) |
String |
toString() |
public DynamicSetRowMapper(org.simpleflatmapper.util.UnaryFactory<MapperKey<K>,SetRowMapper<ROW,SET,T,E>> mapperFactory, org.simpleflatmapper.util.UnaryFactoryWithException<ROW,MapperKey<K>,E> mapperKeyFromRow, org.simpleflatmapper.util.UnaryFactoryWithException<SET,MapperKey<K>,E> mapperKeyFromSet, MapperKeyComparator<K> keyComparator)
public final T map(ROW row) throws MappingException
ContextualSourceMappermap in interface ContextualSourceMapper<ROW,T>row - object to map fromMappingException - if an exception occurspublic final T map(ROW row, MappingContext<? super ROW> context) throws MappingException
SourceMappermap in interface SourceMapper<ROW,T>row - object to map fromcontext - the contextMappingException - if an exception occurspublic final Iterator<T> iterator(SET rs) throws E extends Exception, MappingException
iterator in interface EnumerableMapper<SET,T,E extends Exception>rs - the sourceE - if source error occursMappingException - if an error occurs during the mappingE extends Exceptionpublic final Stream<T> stream(SET set) throws E extends Exception, MappingException
stream in interface EnumerableMapper<SET,T,E extends Exception>set - the sourceE - if source error occursMappingException - if an error occurs during the mappingE extends Exceptionpublic org.simpleflatmapper.util.Enumerable<T> enumerate(SET source) throws E extends Exception, MappingException
enumerate in interface EnumerableMapper<SET,T,E extends Exception>E extends ExceptionMappingExceptionpublic final <H extends org.simpleflatmapper.util.CheckedConsumer<? super T>> H forEach(SET set, H handler) throws E extends Exception, MappingException
EnumerableMapper
The method will return the handler passed as an argument so you can easily chain the calls like
List<T> list = jdbcMapper.forEach(rs, new ListHandler<T>()).getList();
forEach in interface EnumerableMapper<SET,T,E extends Exception>H - the row handler typeset - the sourcehandler - the handler that will get the callbackE - if source error occursMappingException - if an error occurs during the mappingE extends ExceptionCopyright © 2020. All rights reserved.