org.projectnessie.nessie.cli.grammar.ast.RevertContentStatement Maven / Gradle / Ivy
/* Generated by: CongoCC Parser Generator. Do not edit.
* Generated Code for RevertContentStatement AST Node type
* by the ASTNode.java.ftl template
*/
package org.projectnessie.nessie.cli.grammar.ast;
import org.projectnessie.nessie.cli.cmdspec.*;
import org.projectnessie.nessie.cli.grammar.*;
import java.util.*;
import static org.projectnessie.nessie.cli.grammar.Token.TokenType.*;
public class RevertContentStatement extends BaseNode implements RevertContentCommandSpec {
@Override
public String getInCatalog() {
return stringValueOf("inCatalog");
}
@Override
public boolean isDryRun() {
return getNamedChild("dryRun") != null;
}
@Override
public boolean isAllowDeletes() {
return getNamedChild("allowDeletes") != null;
}
@Override
public String getRef() {
return stringValueOf("ref");
}
@Override
public String getRefType() {
Node type = getNamedChild("type");
return type != null ? type.getSource().toUpperCase() : null;
}
@Override
public String getSourceRef() {
return stringValueOf("sourceRef");
}
@Override
public String getSourceRefType() {
Node type = getNamedChild("sourceType");
return type != null ? type.getSource().toUpperCase() : null;
}
@Override
public String getSourceRefTimestampOrHash() {
return stringValueOf("sourceAt");
}
@Override
public List getContentKeys() {
List contentKeys = new ArrayList<>();
List children = children();
for (int i = 0; i < children.size(); i++) {
Node child = children.get(i);
if (child.getType() == OF) {
for (i++; i < children.size();) {
Node key = children.get(i++);
contentKeys.add(((IdentifierOrLiteral) key).getStringValue());
if (children.size() == i || children.get(i++).getType() != AND) {
break;
}
}
break;
}
}
return contentKeys;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy