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

io.deephaven.engine.table.impl.sources.LongAsInstantColumnSource Maven / Gradle / Ivy

There is a newer version: 0.37.1
Show newest version
/**
 * Copyright (c) 2016-2023 Deephaven Data Labs and Patent Pending
 */
package io.deephaven.engine.table.impl.sources;

import io.deephaven.engine.table.ColumnSource;
import io.deephaven.time.DateTimeUtils;

import java.time.Instant;

/**
 * Reinterpret result {@link ColumnSource} implementations that translates {@code long} to {@link Instant} values.
 */
public class LongAsInstantColumnSource extends LongAsTimeSource {

    public LongAsInstantColumnSource(ColumnSource alternateColumnSource) {
        super(Instant.class, alternateColumnSource);
    }

    @Override
    protected Instant makeValue(long val) {
        return DateTimeUtils.epochNanosToInstant(val);
    }

    @Override
    public ColumnSource toInstant() {
        return this;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy