public final class TransformEnumerableMapper<ROW,SET,I,O,E extends Exception> extends Object implements EnumerableMapper<SET,O,E>
| Constructor and Description |
|---|
TransformEnumerableMapper(EnumerableMapper<SET,I,E> delegate,
org.simpleflatmapper.util.Function<I,O> transformer) |
| Modifier and Type | Method and Description |
|---|---|
org.simpleflatmapper.util.Enumerable<O> |
enumerate(SET source) |
<H extends org.simpleflatmapper.util.CheckedConsumer<? super O>> |
forEach(SET source,
H handler)
Loop over the resultSet, map each row to a new newInstance of T and call back the handler
|
Iterator<O> |
iterator(SET source) |
Stream<O> |
stream(SET source) |
public <H extends org.simpleflatmapper.util.CheckedConsumer<? super O>> H forEach(SET source, 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,O,E extends Exception>H - the row handler typesource - the sourcehandler - the handler that will get the callbackE - if source error occursMappingException - if an error occurs during the mappingE extends Exceptionpublic Iterator<O> iterator(SET source) throws E extends Exception, MappingException
iterator in interface EnumerableMapper<SET,O,E extends Exception>source - the sourceE - if source error occursMappingException - if an error occurs during the mappingE extends Exceptionpublic Stream<O> stream(SET source) throws E extends Exception, MappingException
stream in interface EnumerableMapper<SET,O,E extends Exception>source - the sourceE - if source error occursMappingException - if an error occurs during the mappingE extends Exceptionpublic org.simpleflatmapper.util.Enumerable<O> enumerate(SET source) throws E extends Exception, MappingException
enumerate in interface EnumerableMapper<SET,O,E extends Exception>E extends ExceptionMappingExceptionCopyright © 2020. All rights reserved.