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

org.sfm.datastax.impl.setter.DoubleSettableDataSetter Maven / Gradle / Ivy

There is a newer version: 8.2.3
Show newest version
package org.sfm.datastax.impl.setter;

import com.datastax.driver.core.SettableByIndexData;
import org.sfm.reflect.Setter;
import org.sfm.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);
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy