1 /* 2 * Copyright 2015-2018 HuntLabs.cn 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 module hunt.sql.ast.statement.SQLAlterTableRenameIndex; 17 18 import hunt.sql.ast.SQLName; 19 import hunt.sql.ast.SQLObjectImpl; 20 import hunt.sql.visitor.SQLASTVisitor; 21 import hunt.sql.ast.statement.SQLAlterTableItem; 22 23 public class SQLAlterTableRenameIndex : SQLObjectImpl , SQLAlterTableItem { 24 25 private SQLName name; 26 private SQLName to; 27 28 public this(SQLName name, SQLName to){ 29 this.setName(name); 30 this.setTo(to); 31 } 32 33 public this(){ 34 } 35 36 37 override public void accept0(SQLASTVisitor visitor) { 38 if (visitor.visit(this)) { 39 acceptChild(visitor, name); 40 acceptChild(visitor, to); 41 } 42 visitor.endVisit(this); 43 } 44 45 public SQLName getName() { 46 return name; 47 } 48 49 public void setName(SQLName x) { 50 if (x !is null) { 51 x.setParent(this); 52 } 53 this.name = x; 54 } 55 56 public SQLName getTo() { 57 return to; 58 } 59 60 public void setTo(SQLName x) { 61 if (x !is null) { 62 x.setParent(this); 63 } 64 this.to = x; 65 } 66 }