package jetbrains.mps.baseLanguage.typesystem;

/*Generated by MPS */

import org.jetbrains.mps.openapi.model.SNodeReference;
import org.jetbrains.mps.openapi.model.SNode;
import jetbrains.mps.lang.smodel.generator.smodelAdapter.SConceptOperations;
import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory;
import jetbrains.mps.lang.smodel.generator.smodelAdapter.SLinkOperations;
import jetbrains.mps.internal.collections.runtime.ListSequence;
import org.jetbrains.mps.openapi.language.SReferenceLink;
import org.jetbrains.mps.openapi.language.SContainmentLink;

public class VariableTypeDescriptor {

  private final SNodeReference myLocalVariableClass;
  private final SNodeReference myLocalVariableCons;
  private final SNodeReference myVariableInterface;
  private final SNode myTypeParameter;

  public VariableTypeDescriptor(SNodeReference variableInterface, SNodeReference localVariableClass, SNodeReference localVariableCons, SNode typeParameter) {
    myVariableInterface = variableInterface;
    myLocalVariableClass = localVariableClass;
    myLocalVariableCons = localVariableCons;
    myTypeParameter = typeParameter;
  }

  public SNode getVariableInterfaceType() {
    SNode type = SConceptOperations.createNewNode(MetaAdapterFactory.getConcept(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x101de48bf9eL, "jetbrains.mps.baseLanguage.structure.ClassifierType"));
    SLinkOperations.setPointer(type, LINKS.classifier$cxMr, myVariableInterface);
    ListSequence.fromList(SLinkOperations.getChildren(type, LINKS.parameter$oqG$)).addElement(myTypeParameter);
    return type;
  }

  public SNode getLocalVariableClassType() {
    SNode type = SConceptOperations.createNewNode(MetaAdapterFactory.getConcept(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x101de48bf9eL, "jetbrains.mps.baseLanguage.structure.ClassifierType"));
    SLinkOperations.setPointer(type, LINKS.classifier$cxMr, myLocalVariableClass);
    ListSequence.fromList(SLinkOperations.getChildren(type, LINKS.parameter$oqG$)).addElement(myTypeParameter);
    return type;
  }


  public SNodeReference getVariableIntreface() {
    return myVariableInterface;
  }

  public SNodeReference getLocalVariableClass() {
    return myLocalVariableClass;
  }

  public SNodeReference getLocalVariableCons() {
    return myLocalVariableCons;
  }

  public SNode getTypeParameter() {
    return myTypeParameter;
  }

  private static final class LINKS {
    /*package*/ static final SReferenceLink classifier$cxMr = MetaAdapterFactory.getReferenceLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x101de48bf9eL, 0x101de490babL, "classifier");
    /*package*/ static final SContainmentLink parameter$oqG$ = MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x101de48bf9eL, 0x102419671abL, "parameter");
  }
}
