io.deephaven.engine.table.impl.sources.LongAsInstantColumnSource Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of deephaven-engine-table Show documentation
Show all versions of deephaven-engine-table Show documentation
Engine Table: Implementation and closely-coupled utilities
/**
* 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