Sha256: 9118ddd5e944b1bf560e7ecc83cfdc693b6e24983a2f16b5aa7bdaae46cf87cc

Contents?: true

Size: 1.07 KB

Versions: 4

Compression:

Stored size: 1.07 KB

Contents

package org.embulk.output.cassandra.setter;

import com.datastax.driver.core.BoundStatement;
import com.datastax.driver.core.ColumnMetadata;

public class IntColumnSetter extends CassandraColumnSetter
{
    public IntColumnSetter(ColumnMetadata cassandraColumn)
    {
        super(cassandraColumn);
    }

    @Override
    public void setBooleanValue(Boolean value, BoundStatement statement)
    {
        if (value) {
            statement.setInt(cassandraColumn.getName(), 1);
        }
        else {
            statement.setInt(cassandraColumn.getName(), 0);
        }
    }

    @Override
    public void setLongValue(Long value, BoundStatement statement)
    {
        statement.setInt(cassandraColumn.getName(), value.intValue());
    }

    @Override
    public void setDoubleValue(Double value, BoundStatement statement)
    {
        statement.setInt(cassandraColumn.getName(), value.intValue());
    }

    @Override
    public void setStringValue(String value, BoundStatement statement)
    {
        statement.setInt(cassandraColumn.getName(), Integer.parseInt(value));
    }
}

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
embulk-output-cassandra-0.3.0 src/main/java/org/embulk/output/cassandra/setter/IntColumnSetter.java
embulk-output-cassandra-0.2.0 src/main/java/org/embulk/output/cassandra/setter/IntColumnSetter.java
embulk-output-cassandra-0.1.1 src/main/java/org/embulk/output/cassandra/setter/IntColumnSetter.java
embulk-output-cassandra-0.1.0 src/main/java/org/embulk/output/cassandra/setter/IntColumnSetter.java