All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ru.yandex.clickhouse.response.parser.ClickHouseStringParser Maven / Gradle / Ivy

There is a newer version: 0.6.5
Show newest version
package ru.yandex.clickhouse.response.parser;

import java.sql.SQLException;
import java.util.TimeZone;

import ru.yandex.clickhouse.response.ByteFragment;
import ru.yandex.clickhouse.response.ClickHouseColumnInfo;

final class ClickHouseStringParser extends ClickHouseValueParser {

    private static ClickHouseStringParser instance;

    static ClickHouseStringParser getInstance() {
        if (instance == null) {
            instance = new ClickHouseStringParser();
        }
        return instance;
    }

    private ClickHouseStringParser() {
        // prevent regular instantiation
    }

    @Override
    public String parse(ByteFragment value, ClickHouseColumnInfo columnInfo, TimeZone resultTimeZone)
            throws SQLException {
        return value.asString(true);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy