org.simpleflatmapper.map.setter.ContextualSetterFactoryAdapter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sfm-map Show documentation
Show all versions of sfm-map Show documentation
Java library to map flat record - ResultSet, csv - to java object with minimum configuration and low footprint.
The newest version!
package org.simpleflatmapper.map.setter;
import org.simpleflatmapper.converter.ContextFactoryBuilder;
import org.simpleflatmapper.map.context.MappingContextFactoryBuilder;
import org.simpleflatmapper.map.getter.ContextualGetter;
import org.simpleflatmapper.map.getter.ContextualGetterAdapter;
import org.simpleflatmapper.map.getter.ContextualGetterFactory;
import org.simpleflatmapper.reflect.Getter;
import org.simpleflatmapper.reflect.Setter;
import org.simpleflatmapper.reflect.SetterFactory;
import org.simpleflatmapper.reflect.getter.GetterFactory;
import java.lang.reflect.Type;
public class ContextualSetterFactoryAdapter implements ContextualSetterFactory {
private final SetterFactory delegate;
public ContextualSetterFactoryAdapter(SetterFactory delegate) {
this.delegate = delegate;
}
@Override
public ContextualSetter getSetter(K arg, ContextFactoryBuilder contextFactoryBuilder) {
Setter setter = delegate.getSetter(arg);
if (setter == null) return null;
return ContextualSetterAdapter.of(setter);
}
}