Sha256: 9ae1108768cc922cd84f8fa41ae55e5f36f08d3b730cb1b99cd4336605e995e2

Contents?: true

Size: 834 Bytes

Versions: 5

Compression:

Stored size: 834 Bytes

Contents

package org.embulk.spi.type;

import org.embulk.spi.time.Timestamp;

public class TimestampType
        extends AbstractType
{
    static final TimestampType TIMESTAMP = new TimestampType();

    private static final String DEFAULT_FORMAT = "%Y-%m-%d %H-%M-%S,%N %z";

    private final String format;

    private TimestampType()
    {
        this(null);
    }

    private TimestampType(String format)
    {
        super("timestamp", Timestamp.class, 12);  // long msec + int nsec
        this.format = format;
    }

    public TimestampType withFormat(String format)
    {
        // TODO is this correct design...?
        return new TimestampType(format);
    }

    public String getFormat()
    {
        if (format == null) {
            return DEFAULT_FORMAT;
        } else {
            return format;
        }
    }
}

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
embulk-0.3.1 embulk-core/src/main/java/org/embulk/spi/type/TimestampType.java
embulk-0.3.0 embulk-core/src/main/java/org/embulk/spi/type/TimestampType.java
embulk-0.2.1 embulk-core/src/main/java/org/embulk/spi/type/TimestampType.java
embulk-0.2.0 embulk-core/src/main/java/org/embulk/spi/type/TimestampType.java
embulk-0.1.0 embulk-core/src/main/java/org/embulk/spi/type/TimestampType.java