public Node createTypeDeclaration(String kind, Node modifiers, Node name, Node params, Node body, List<Node> addons) {
if (kind.equals("interface")) return createInterfaceDeclaration(modifiers, name, params, body, addons);
ClassDeclaration decl = new ClassDeclaration().astName(createIdentifierIfNeeded(name, currentPos())).rawBody(body);
if (modifiers != null) decl.astModifiers(createModifiersIfNeeded(modifiers, currentPos()));
if (params instanceof TemporaryNode.OrphanedTypeVariables) {
TemporaryNode.OrphanedTypeVariables otv = (TemporaryNode.OrphanedTypeVariables)params;
if (otv.variables != null) for (Node typeParameter : otv.variables) {
if (typeParameter != null) decl.rawTypeVariables().addToEnd(typeParameter);
}