package com.chenyang.druid.sql.ast;

import com.chenyang.druid.sql.ast.expr.SQLIntegerExpr;
import com.chenyang.druid.sql.ast.statement.SQLAssignItem;
import java.util.ArrayList;
import java.util.List;

public abstract class SQLSubPartitionBy extends SQLObjectImpl {
   protected SQLExpr subPartitionsCount;
   protected boolean linear;
   protected List<SQLAssignItem> options = new ArrayList();
   protected List<SQLSubPartition> subPartitionTemplate = new ArrayList();
   protected SQLIntegerExpr lifecycle;

   public SQLExpr getSubPartitionsCount() {
      return this.subPartitionsCount;
   }

   public void setSubPartitionsCount(SQLExpr x) {
      if (x != null) {
         x.setParent(this);
      }

      this.subPartitionsCount = x;
   }

   public boolean isLinear() {
      return this.linear;
   }

   public void setLinear(boolean linear) {
      this.linear = linear;
   }

   public List<SQLAssignItem> getOptions() {
      return this.options;
   }

   public List<SQLSubPartition> getSubPartitionTemplate() {
      return this.subPartitionTemplate;
   }

   public void cloneTo(SQLSubPartitionBy x) {
      if (this.subPartitionsCount != null) {
         x.setSubPartitionsCount(this.subPartitionsCount.clone());
      }

      x.linear = this.linear;

      for(SQLAssignItem option : this.options) {
         SQLAssignItem option2 = option.clone();
         option2.setParent(x);
         x.options.add(option2);
      }

      for(SQLSubPartition p : this.subPartitionTemplate) {
         SQLSubPartition p2 = p.clone();
         p2.setParent(x);
         x.subPartitionTemplate.add(p2);
      }

      x.lifecycle = this.lifecycle;
   }

   public SQLIntegerExpr getLifecycle() {
      return this.lifecycle;
   }

   public void setLifecycle(SQLIntegerExpr lifecycle) {
      this.lifecycle = lifecycle;
   }

   public boolean isPartitionByColumn(long columnNameHashCode64) {
      return false;
   }

   public abstract SQLSubPartitionBy clone();
}
