Sha256: 6c382c52826b2c4c5c9a939eb769090e81b0cfa4245de6d6e00e0ab2d3aaff35

Contents?: true

Size: 1.49 KB

Versions: 76

Compression:

Stored size: 1.49 KB

Contents

package org.embulk.spi.util.dynamic;

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

public class JsonColumnSetter
        extends AbstractDynamicColumnSetter
{
    private final TimestampFormatter timestampFormatter;

    public JsonColumnSetter(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.setJson(column, ValueFactory.newBoolean(v));
    }

    @Override
    public void set(long v)
    {
        pageBuilder.setJson(column, ValueFactory.newInteger(v));
    }

    @Override
    public void set(double v)
    {
        pageBuilder.setJson(column, ValueFactory.newFloat(v));
    }

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

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

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

Version data entries

76 entries across 76 versions & 1 rubygems

Version Path
embulk-0.8.19 embulk-core/src/main/java/org/embulk/spi/util/dynamic/JsonColumnSetter.java
embulk-0.8.19-java embulk-core/src/main/java/org/embulk/spi/util/dynamic/JsonColumnSetter.java
embulk-0.8.18 embulk-core/src/main/java/org/embulk/spi/util/dynamic/JsonColumnSetter.java
embulk-0.8.18-java embulk-core/src/main/java/org/embulk/spi/util/dynamic/JsonColumnSetter.java
embulk-0.8.17 embulk-core/src/main/java/org/embulk/spi/util/dynamic/JsonColumnSetter.java
embulk-0.8.17-java embulk-core/src/main/java/org/embulk/spi/util/dynamic/JsonColumnSetter.java
embulk-0.8.16 embulk-core/src/main/java/org/embulk/spi/util/dynamic/JsonColumnSetter.java
embulk-0.8.16-java embulk-core/src/main/java/org/embulk/spi/util/dynamic/JsonColumnSetter.java
embulk-0.8.15 embulk-core/src/main/java/org/embulk/spi/util/dynamic/JsonColumnSetter.java
embulk-0.8.15-java embulk-core/src/main/java/org/embulk/spi/util/dynamic/JsonColumnSetter.java
embulk-0.8.14 embulk-core/src/main/java/org/embulk/spi/util/dynamic/JsonColumnSetter.java
embulk-0.8.14-java embulk-core/src/main/java/org/embulk/spi/util/dynamic/JsonColumnSetter.java
embulk-0.8.13 embulk-core/src/main/java/org/embulk/spi/util/dynamic/JsonColumnSetter.java
embulk-0.8.13-java embulk-core/src/main/java/org/embulk/spi/util/dynamic/JsonColumnSetter.java
embulk-0.8.12 embulk-core/src/main/java/org/embulk/spi/util/dynamic/JsonColumnSetter.java
embulk-0.8.12-java embulk-core/src/main/java/org/embulk/spi/util/dynamic/JsonColumnSetter.java
embulk-0.8.11-java embulk-core/src/main/java/org/embulk/spi/util/dynamic/JsonColumnSetter.java
embulk-0.8.11 embulk-core/src/main/java/org/embulk/spi/util/dynamic/JsonColumnSetter.java
embulk-0.8.10 embulk-core/src/main/java/org/embulk/spi/util/dynamic/JsonColumnSetter.java
embulk-0.8.10-java embulk-core/src/main/java/org/embulk/spi/util/dynamic/JsonColumnSetter.java