package sqlancer.common.ast; import java.util.Collections; import java.util.List; public class SelectBase { List fetchColumns; List groupByExpressions = Collections.emptyList(); List orderByExpressions = Collections.emptyList(); List joinList = Collections.emptyList(); List fromList; T whereClause; T havingClause; T limitClause; T offsetClause; public void setFetchColumns(List fetchColumns) { if (fetchColumns == null || fetchColumns.isEmpty()) { throw new IllegalArgumentException(); } this.fetchColumns = fetchColumns; } public List getFetchColumns() { if (fetchColumns == null) { throw new IllegalStateException(); } return fetchColumns; } public void setFromList(List fromList) { if (fromList == null /* || fromList.size() == 0 TODO: refactor the CockroachDB implementation */) { throw new IllegalArgumentException(); } this.fromList = fromList; } public List getFromList() { if (fromList == null) { throw new IllegalStateException(); } return fromList; } public void setGroupByExpressions(List groupByExpressions) { if (groupByExpressions == null) { throw new IllegalArgumentException(); } this.groupByExpressions = groupByExpressions; } public List getGroupByExpressions() { assert groupByExpressions != null; return groupByExpressions; } public void setOrderByExpressions(List orderByExpressions) { if (orderByExpressions == null) { throw new IllegalArgumentException(); } this.orderByExpressions = orderByExpressions; } public List getOrderByExpressions() { assert orderByExpressions != null; return orderByExpressions; } public void setWhereClause(T whereClause) { this.whereClause = whereClause; } public T getWhereClause() { return whereClause; } public void setHavingClause(T havingClause) { this.havingClause = havingClause; } public T getHavingClause() { return havingClause; } public void setLimitClause(T limitClause) { this.limitClause = limitClause; } public T getLimitClause() { return limitClause; } public void setOffsetClause(T offsetClause) { this.offsetClause = offsetClause; } public T getOffsetClause() { return offsetClause; } public List getJoinList() { return joinList; } public void setJoinList(List joinList) { this.joinList = joinList; } }