Sha256: a35d54454758d767a5e21fee74eb258181a031e0247b0273b4b15155ff928563

Contents?: true

Size: 1.17 KB

Versions: 26

Compression:

Stored size: 1.17 KB

Contents

package org.embulk.spi;

import java.util.List;
import com.google.common.base.Objects;
import com.google.common.collect.ImmutableList;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

public class SchemaConfig
{
    private final List<ColumnConfig> columns;

    @JsonCreator
    public SchemaConfig(List<ColumnConfig> columns)
    {
        this.columns = columns;
    }

    @JsonValue
    public List<ColumnConfig> getColumns()
    {
        return columns;
    }

    public Schema toSchema()
    {
        ImmutableList.Builder<Column> builder = ImmutableList.builder();
        for (int i=0; i < columns.size(); i++) {
            builder.add(columns.get(i).toColumn(i));
        }
        return new Schema(builder.build());
    }

    @Override
    public boolean equals(Object obj)
    {
        if (this == obj) {
            return true;
        }
        if (!(obj instanceof SchemaConfig)) {
            return false;
        }
        SchemaConfig other = (SchemaConfig) obj;
        return Objects.equal(columns, other.columns);
    }

    @Override
    public int hashCode()
    {
        return Objects.hashCode(columns);
    }
}

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
embulk-0.6.2 embulk-core/src/main/java/org/embulk/spi/SchemaConfig.java
embulk-0.6.1 embulk-core/src/main/java/org/embulk/spi/SchemaConfig.java
embulk-0.6.0 embulk-core/src/main/java/org/embulk/spi/SchemaConfig.java
embulk-0.5.5 embulk-core/src/main/java/org/embulk/spi/SchemaConfig.java
embulk-0.5.4 embulk-core/src/main/java/org/embulk/spi/SchemaConfig.java
embulk-0.5.3 embulk-core/src/main/java/org/embulk/spi/SchemaConfig.java
embulk-0.5.2 embulk-core/src/main/java/org/embulk/spi/SchemaConfig.java
embulk-0.5.1 embulk-core/src/main/java/org/embulk/spi/SchemaConfig.java
embulk-0.5.0 embulk-core/src/main/java/org/embulk/spi/SchemaConfig.java
embulk-0.4.10 embulk-core/src/main/java/org/embulk/spi/SchemaConfig.java
embulk-0.4.9 embulk-core/src/main/java/org/embulk/spi/SchemaConfig.java
embulk-0.4.8 embulk-core/src/main/java/org/embulk/spi/SchemaConfig.java
embulk-0.4.7 embulk-core/src/main/java/org/embulk/spi/SchemaConfig.java
embulk-0.4.6 embulk-core/src/main/java/org/embulk/spi/SchemaConfig.java
embulk-0.4.5 embulk-core/src/main/java/org/embulk/spi/SchemaConfig.java
embulk-0.4.4 embulk-core/src/main/java/org/embulk/spi/SchemaConfig.java
embulk-0.4.3 embulk-core/src/main/java/org/embulk/spi/SchemaConfig.java
embulk-0.4.2 embulk-core/src/main/java/org/embulk/spi/SchemaConfig.java
embulk-0.4.1 embulk-core/src/main/java/org/embulk/spi/SchemaConfig.java
embulk-0.4.0 embulk-core/src/main/java/org/embulk/spi/SchemaConfig.java