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.29 embulk-core/src/main/java/org/embulk/spi/util/dynamic/StringColumnSetter.java
embulk-0.8.29-java embulk-core/src/main/java/org/embulk/spi/util/dynamic/StringColumnSetter.java
embulk-0.8.28 embulk-core/src/main/java/org/embulk/spi/util/dynamic/StringColumnSetter.java
embulk-0.8.28-java embulk-core/src/main/java/org/embulk/spi/util/dynamic/StringColumnSetter.java
embulk-0.8.27 embulk-core/src/main/java/org/embulk/spi/util/dynamic/StringColumnSetter.java
embulk-0.8.27-java embulk-core/src/main/java/org/embulk/spi/util/dynamic/StringColumnSetter.java
embulk-0.8.26 embulk-core/src/main/java/org/embulk/spi/util/dynamic/StringColumnSetter.java
embulk-0.8.26-java embulk-core/src/main/java/org/embulk/spi/util/dynamic/StringColumnSetter.java
embulk-0.8.25 embulk-core/src/main/java/org/embulk/spi/util/dynamic/StringColumnSetter.java
embulk-0.8.25-java embulk-core/src/main/java/org/embulk/spi/util/dynamic/StringColumnSetter.java
embulk-0.8.24 embulk-core/src/main/java/org/embulk/spi/util/dynamic/StringColumnSetter.java
embulk-0.8.24-java embulk-core/src/main/java/org/embulk/spi/util/dynamic/StringColumnSetter.java
embulk-0.8.23 embulk-core/src/main/java/org/embulk/spi/util/dynamic/StringColumnSetter.java
embulk-0.8.23-java embulk-core/src/main/java/org/embulk/spi/util/dynamic/StringColumnSetter.java
embulk-0.8.22 embulk-core/src/main/java/org/embulk/spi/util/dynamic/StringColumnSetter.java
embulk-0.8.22-java embulk-core/src/main/java/org/embulk/spi/util/dynamic/StringColumnSetter.java
embulk-0.8.21 embulk-core/src/main/java/org/embulk/spi/util/dynamic/StringColumnSetter.java
embulk-0.8.21-java embulk-core/src/main/java/org/embulk/spi/util/dynamic/StringColumnSetter.java
embulk-0.8.20 embulk-core/src/main/java/org/embulk/spi/util/dynamic/StringColumnSetter.java
embulk-0.8.20-java embulk-core/src/main/java/org/embulk/spi/util/dynamic/StringColumnSetter.java