Package net.obvj.confectory.mapper
Class DummyMapper<T>
- java.lang.Object
-
- net.obvj.confectory.mapper.DummyMapper<T>
-
-
Constructor Summary
Constructors Constructor Description DummyMapper(Function<T,ConfigurationHelper<T>> configurationHelperCreator)Creates a dummyMapperwith aConfigurationHelperfactory function.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Tapply(InputStream input)Applies thisMapperinto the given input.ConfigurationHelper<T>configurationHelper(T bean)Creates a newConfigurationHelperinstance recommended by thisMapper.
-
-
-
Constructor Detail
-
DummyMapper
public DummyMapper(Function<T,ConfigurationHelper<T>> configurationHelperCreator)
Creates a dummyMapperwith aConfigurationHelperfactory function.- Parameters:
configurationHelperCreator- theConfigurationHelperfactory function to be applied by thisMapper; not null- Throws:
NullPointerException- if a null helper factory function is provided
-
-
Method Detail
-
apply
public T apply(InputStream input) throws IOException
Description copied from interface:MapperApplies thisMapperinto the given input.Note: The input stream must be closed by the caller after the mapping operation.
- Specified by:
applyin interfaceMapper<T>- Parameters:
input- the input stream to be mapped- Returns:
- the mapped object
- Throws:
IOException- if a low-level I/O problem (such and unexpected end-of-input, or network error) occurs
-
configurationHelper
public ConfigurationHelper<T> configurationHelper(T bean)
Description copied from interface:MapperCreates a newConfigurationHelperinstance recommended by thisMapper.- Specified by:
configurationHelperin interfaceMapper<T>- Parameters:
bean- the configuration object to be used by the helper- Returns:
- a new
ConfigurationHelperinstance
-
-