All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.simpleflatmapper.map.mapper.TransformSourceMapper Maven / Gradle / Ivy

Go to download

Java library to map flat record - ResultSet, csv - to java object with minimum configuration and low footprint.

There is a newer version: 9.0.2
Show newest version
package org.simpleflatmapper.map.mapper;

import org.simpleflatmapper.map.ContextualSourceMapper;
import org.simpleflatmapper.map.MappingContext;
import org.simpleflatmapper.map.MappingException;
import org.simpleflatmapper.map.SourceMapper;
import org.simpleflatmapper.util.Function;

public final class TransformSourceMapper implements ContextualSourceMapper {

	private final ContextualSourceMapper delegate;
	private final Function transformer;

	public TransformSourceMapper(ContextualSourceMapper delegate, Function transformer) {
		this.delegate = delegate;
		this.transformer = transformer;
	}

	@Override
	public O map(ROW source) throws MappingException {
		return transformer.apply(delegate.map(source));
	}

	@Override
	public O map(ROW source, MappingContext context) throws MappingException {
		return transformer.apply(delegate.map(source, context));
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy