package jetbrains.mps.baseLanguage.actions;

/*Generated by MPS */

import jetbrains.mps.openapi.actions.descriptor.PasteWrapper;
import org.jetbrains.mps.openapi.language.SAbstractConcept;
import org.jetbrains.mps.openapi.model.SNode;
import jetbrains.mps.smodel.action.SNodeFactoryOperations;
import jetbrains.mps.lang.smodel.generator.smodelAdapter.SPropertyOperations;
import jetbrains.mps.lang.smodel.generator.smodelAdapter.SLinkOperations;
import jetbrains.mps.internal.collections.runtime.ListSequence;
import org.jetbrains.mps.openapi.language.SConcept;
import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory;
import org.jetbrains.mps.openapi.language.SInterfaceConcept;
import org.jetbrains.mps.openapi.language.SProperty;
import org.jetbrains.mps.openapi.language.SContainmentLink;

public final class wrappers_PasteWrapper_5 implements PasteWrapper {
  @Override
  public SAbstractConcept getSourceConcept() {
    return CONCEPTS.LocalVariableDeclarationStatement$4w;
  }
  @Override
  public SAbstractConcept getTargetConcept() {
    return CONCEPTS.ClassifierMember$At;
  }
  @Override
  public SNode wrap(SNode sourceNode) {
    SNode variable = SNodeFactoryOperations.createNewNode(CONCEPTS.FieldDeclaration$ie, null);
    SPropertyOperations.set(variable, PROPS.name$MnvL, SPropertyOperations.getString(SLinkOperations.getTarget(sourceNode, LINKS.localVariableDeclaration$RpjM), PROPS.name$MnvL));
    SLinkOperations.setTarget(variable, LINKS.type$a1UY, SLinkOperations.getTarget(SLinkOperations.getTarget(sourceNode, LINKS.localVariableDeclaration$RpjM), LINKS.type$a1UY));
    ListSequence.fromList(SLinkOperations.getChildren(variable, LINKS.annotation$K49I)).addSequence(ListSequence.fromList(SLinkOperations.getChildren(SLinkOperations.getTarget(sourceNode, LINKS.localVariableDeclaration$RpjM), LINKS.annotation$K49I)));
    SPropertyOperations.set(variable, PROPS.isFinal$gvTP, SPropertyOperations.getBoolean(SLinkOperations.getTarget(sourceNode, LINKS.localVariableDeclaration$RpjM), PROPS.isFinal$gvTP));
    SLinkOperations.setTarget(variable, LINKS.initializer$2twD, SLinkOperations.getTarget(SLinkOperations.getTarget(sourceNode, LINKS.localVariableDeclaration$RpjM), LINKS.initializer$2twD));

    return variable;
  }

  private static final class CONCEPTS {
    /*package*/ static final SConcept LocalVariableDeclarationStatement$4w = MetaAdapterFactory.getConcept(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc67c7f0L, "jetbrains.mps.baseLanguage.structure.LocalVariableDeclarationStatement");
    /*package*/ static final SInterfaceConcept ClassifierMember$At = MetaAdapterFactory.getInterfaceConcept(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x112574373bdL, "jetbrains.mps.baseLanguage.structure.ClassifierMember");
    /*package*/ static final SConcept FieldDeclaration$ie = MetaAdapterFactory.getConcept(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8c108ca68L, "jetbrains.mps.baseLanguage.structure.FieldDeclaration");
  }

  private static final class PROPS {
    /*package*/ static final SProperty name$MnvL = MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name");
    /*package*/ static final SProperty isFinal$gvTP = MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8c37a7f6eL, 0x111f9e9f00cL, "isFinal");
  }

  private static final class LINKS {
    /*package*/ static final SContainmentLink localVariableDeclaration$RpjM = MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc67c7f0L, 0xf8cc67c7f1L, "localVariableDeclaration");
    /*package*/ static final SContainmentLink type$a1UY = MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x450368d90ce15bc3L, 0x4ed4d318133c80ceL, "type");
    /*package*/ static final SContainmentLink annotation$K49I = MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x114a6be947aL, 0x114a6beb0bdL, "annotation");
    /*package*/ static final SContainmentLink initializer$2twD = MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8c37a7f6eL, 0xf8c37f506eL, "initializer");
  }
}
