org.simpleflatmapper.datastax.impl.setter.DoubleSettableDataSetter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sfm-datastax Show documentation
Show all versions of sfm-datastax Show documentation
Cassandra Datastax SFM supports.
package org.simpleflatmapper.datastax.impl.setter;
import com.datastax.driver.core.SettableByIndexData;
import org.simpleflatmapper.reflect.Setter;
import org.simpleflatmapper.reflect.primitive.DoubleSetter;
public class DoubleSettableDataSetter implements Setter, DoubleSetter {
private final int index;
public DoubleSettableDataSetter(int index) {
this.index = index;
}
@Override
public void setDouble(SettableByIndexData target, double value) throws Exception {
target.setDouble(index, value);
}
@Override
public void set(SettableByIndexData target, Double value) throws Exception {
if (value == null) {
target.setToNull(index);
} else {
target.setDouble(index, value);
}
}
}