io.deephaven.engine.table.impl.by.rollup.NullColumns 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-2022 Deephaven Data Labs and Patent Pending
*/
package io.deephaven.engine.table.impl.by.rollup;
import io.deephaven.annotations.BuildableStyle;
import org.immutables.value.Value;
import java.util.Map;
/**
* {@link RollupAggregation} that allows columns to be nulled-out at higher aggregation levels.
*/
@Value.Immutable
@BuildableStyle
public abstract class NullColumns extends RollupAggregationBase {
public static NullColumns of(String name, Class> type) {
return builder().putResultColumns(name, type).build();
}
public static NullColumns from(Map> resultColumns) {
return builder().putAllResultColumns(resultColumns).build();
}
public static Builder builder() {
return ImmutableNullColumns.builder();
}
public abstract Map> resultColumns();
@Override
public final V walk(V visitor) {
visitor.visit(this);
return visitor;
}
@Value.Check
final void checkNonEmpty() {
if (resultColumns().isEmpty()) {
throw new IllegalArgumentException(
String.format("%s should have at least one result column", NullColumns.class));
}
}
public interface Builder {
Builder putResultColumns(String name, Class> type);
Builder putAllResultColumns(Map> resultColumns);
NullColumns build();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy