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

org.sfm.datastax.impl.setter.LongSettableDataSetter 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.LongSetter;

public class LongSettableDataSetter implements Setter, LongSetter {
    private final int index;

    public LongSettableDataSetter(int index) {
        this.index = index;
    }

    @Override
    public void setLong(SettableByIndexData target, long value) throws Exception {
        target.setLong(index, value);
    }

    @Override
    public void set(SettableByIndexData target, Long value) throws Exception {
        if (value == null) {
            target.setToNull(index);
        } else {
            target.setLong(index, value);
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy