Sha256: 95673ac386f08b4daa5b1ce5eb6e9838390e36be1740476c34e27f2c071c55ea

Contents?: true

Size: 1.38 KB

Versions: 78

Compression:

Stored size: 1.38 KB

Contents

package org.embulk.spi.util.dynamic;

import org.embulk.spi.PageBuilder;
import org.embulk.spi.Column;
import org.embulk.spi.time.Timestamp;
import org.embulk.spi.time.TimestampFormatter;
import org.msgpack.value.Value;

public class StringColumnSetter
        extends AbstractDynamicColumnSetter
{
    private final TimestampFormatter timestampFormatter;

    public StringColumnSetter(PageBuilder pageBuilder, Column column,
            DefaultValueSetter defaultValue,
            TimestampFormatter timestampFormatter)
    {
        super(pageBuilder, column, defaultValue);
        this.timestampFormatter = timestampFormatter;
    }

    @Override
    public void setNull()
    {
        pageBuilder.setNull(column);
    }

    @Override
    public void set(boolean v)
    {
        pageBuilder.setString(column, Boolean.toString(v));
    }

    @Override
    public void set(long v)
    {
        pageBuilder.setString(column, Long.toString(v));
    }

    @Override
    public void set(double v)
    {
        pageBuilder.setString(column, Double.toString(v));
    }

    @Override
    public void set(String v)
    {
        pageBuilder.setString(column, v);
    }

    @Override
    public void set(Timestamp v)
    {
        pageBuilder.setString(column, timestampFormatter.format(v));
    }

    @Override
    public void set(Value v)
    {
        pageBuilder.setString(column, v.toJson());
    }
}

Version data entries

78 entries across 78 versions & 1 rubygems

Version Path
embulk-0.8.9 embulk-core/src/main/java/org/embulk/spi/util/dynamic/StringColumnSetter.java
embulk-0.8.9-java embulk-core/src/main/java/org/embulk/spi/util/dynamic/StringColumnSetter.java
embulk-0.8.8 embulk-core/src/main/java/org/embulk/spi/util/dynamic/StringColumnSetter.java
embulk-0.8.8-java embulk-core/src/main/java/org/embulk/spi/util/dynamic/StringColumnSetter.java
embulk-0.8.7 embulk-core/src/main/java/org/embulk/spi/util/dynamic/StringColumnSetter.java
embulk-0.8.7-java embulk-core/src/main/java/org/embulk/spi/util/dynamic/StringColumnSetter.java
embulk-0.8.6 embulk-core/src/main/java/org/embulk/spi/util/dynamic/StringColumnSetter.java
embulk-0.8.6-java embulk-core/src/main/java/org/embulk/spi/util/dynamic/StringColumnSetter.java
embulk-0.8.5 embulk-core/src/main/java/org/embulk/spi/util/dynamic/StringColumnSetter.java
embulk-0.8.5-java embulk-core/src/main/java/org/embulk/spi/util/dynamic/StringColumnSetter.java
embulk-0.8.4 embulk-core/src/main/java/org/embulk/spi/util/dynamic/StringColumnSetter.java
embulk-0.8.4-java embulk-core/src/main/java/org/embulk/spi/util/dynamic/StringColumnSetter.java
embulk-0.8.3 embulk-core/src/main/java/org/embulk/spi/util/dynamic/StringColumnSetter.java
embulk-0.8.3-java embulk-core/src/main/java/org/embulk/spi/util/dynamic/StringColumnSetter.java
embulk-0.8.2 embulk-core/src/main/java/org/embulk/spi/util/dynamic/StringColumnSetter.java
embulk-0.8.2-java embulk-core/src/main/java/org/embulk/spi/util/dynamic/StringColumnSetter.java
embulk-0.8.1 embulk-core/src/main/java/org/embulk/spi/util/dynamic/StringColumnSetter.java
embulk-0.8.1-java embulk-core/src/main/java/org/embulk/spi/util/dynamic/StringColumnSetter.java