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

org.simpleflatmapper.datastax.impl.getter.DatastaxShortGetter Maven / Gradle / Ivy

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

import com.datastax.driver.core.GettableByIndexData;
import org.simpleflatmapper.datastax.DataHelper;
import org.simpleflatmapper.reflect.Getter;
import org.simpleflatmapper.reflect.primitive.ShortGetter;

public class DatastaxShortGetter implements ShortGetter, Getter {

    private final int index;

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

    @Override
    public Short get(GettableByIndexData target) throws Exception {
        if (target.isNull(index)) {
            return null;
        }
        return getShort(target);
    }

    @Override
    public short getShort(GettableByIndexData target) throws Exception {
        return DataHelper.getShort(index, target);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy