org.sfm.datastax.SettableDataMapperBuilder Maven / Gradle / Ivy
package org.sfm.datastax;
import com.datastax.driver.core.BoundStatement;
import com.datastax.driver.core.SettableByIndexData;
import org.sfm.map.*;
import org.sfm.map.column.FieldMapperColumnDefinition;
import org.sfm.map.mapper.ConstantTargetFieldMapperFactory;
import org.sfm.reflect.Instantiator;
import org.sfm.reflect.meta.ClassMeta;
public class SettableDataMapperBuilder extends AbstractWriterBuilder> {
public SettableDataMapperBuilder(
ClassMeta classMeta,
MapperConfig> mapperConfig,
ConstantTargetFieldMapperFactory fieldMapperFactory) {
super(classMeta, SettableByIndexData.class, mapperConfig, fieldMapperFactory);
}
@Override
protected Instantiator getInstantiator() {
return new NullInstantiator();
}
@Override
protected DatastaxColumnKey newKey(String column, int i, FieldMapperColumnDefinition columnDefinition) {
return new DatastaxColumnKey(column, i);
}
private static class NullInstantiator implements Instantiator {
@Override
public BoundStatement newInstance(T o) throws Exception {
throw new UnsupportedOperationException();
}
}
protected int getStartingIndex() {
return 0;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy