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

org.simpleflatmapper.datastax.impl.setter.DateSettableDataSetter Maven / Gradle / Ivy

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

import com.datastax.driver.core.LocalDate;
import com.datastax.driver.core.SettableByIndexData;
import org.simpleflatmapper.reflect.Setter;

public class DateSettableDataSetter implements Setter{
    private final int index;

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy