io.wizzie.enricher.query.antlr4.Select Maven / Gradle / Ivy
package io.wizzie.enricher.query.antlr4;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import static com.cookingfox.guava_preconditions.Preconditions.checkNotNull;
public class Select {
List dimensions = new ArrayList<>();
List streams = new ArrayList<>();
public Select() {
this(Collections.EMPTY_LIST, Collections.EMPTY_LIST);
}
public Select(List dimensions, List streams) {
this.dimensions = checkNotNull(dimensions, "\"dimensions\" attribute is required");
this.streams = checkNotNull(streams, "\"streams\" attribute is required");
}
public void setDimensions(List newDimensionsList) {
dimensions = newDimensionsList;
}
public void addNewDimension(String dimension) {
dimensions.add(dimension);
}
public void addStream(Stream newStram) {
streams.add(newStram);
}
public void setStreams(List newStreamsList) {
streams = newStreamsList;
}
public List getDimensions() {
return dimensions;
}
public List getStreams() {
return streams;
}
public void validate() {
checkNotNull(dimensions, "\"dimensions\" attribute is required");
checkNotNull(streams, "\"streams\" attribute is required");
streams.forEach(Stream::validate);
}
}