package jetbrains.mps.baseLanguage.kotlinRefs.behavior;

/*Generated by MPS */

import jetbrains.mps.core.aspects.behaviour.BaseBHDescriptor;
import org.jetbrains.mps.openapi.language.SAbstractConcept;
import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory;
import jetbrains.mps.core.aspects.behaviour.api.SMethod;
import org.jetbrains.mps.openapi.model.SNode;
import jetbrains.mps.core.aspects.behaviour.SMethodBuilder;
import jetbrains.mps.core.aspects.behaviour.SJavaCompoundTypeImpl;
import jetbrains.mps.core.aspects.behaviour.AccessPrivileges;
import jetbrains.mps.kotlin.api.declaration.ParameterDeclaration;
import java.util.List;
import java.util.Arrays;
import org.jetbrains.annotations.NotNull;
import jetbrains.mps.baseLanguage.behavior.IOperation__BehaviorDescriptor;
import jetbrains.mps.internal.collections.runtime.Sequence;
import jetbrains.mps.lang.smodel.generator.smodelAdapter.SLinkOperations;
import jetbrains.mps.lang.smodel.generator.smodelAdapter.SConceptOperations;
import jetbrains.mps.core.aspects.behaviour.api.SConstructor;
import org.jetbrains.annotations.Nullable;
import jetbrains.mps.core.aspects.behaviour.api.BHMethodNotFoundException;
import org.jetbrains.mps.openapi.language.SReferenceLink;

public final class KotlinPropertySetterCall__BehaviorDescriptor extends BaseBHDescriptor {
  private static final SAbstractConcept CONCEPT = MetaAdapterFactory.getConcept(0x2405a196e75d462cL, 0x938bae8e3fac20aaL, 0x3569a755572a0ffbL, "jetbrains.mps.baseLanguage.kotlinRefs.structure.KotlinPropertySetterCall");

  public static final SMethod<SNode> getReceiver_idUG7NftRxKM = new SMethodBuilder<SNode>(new SJavaCompoundTypeImpl((Class<SNode>) ((Class) Object.class))).name("getReceiver").modifiers(8, AccessPrivileges.PUBLIC).concept(CONCEPT).baseMethodId(1057254320151338034L).languageId(0x938bae8e3fac20aaL, 0x2405a196e75d462cL).build2();
  public static final SMethod<Iterable<ParameterDeclaration>> getFunctionParameters_idUG7NftR_2Q = new SMethodBuilder<Iterable<ParameterDeclaration>>(new SJavaCompoundTypeImpl((Class<Iterable<ParameterDeclaration>>) ((Class) Object.class))).name("getFunctionParameters").modifiers(8, AccessPrivileges.PUBLIC).concept(CONCEPT).baseMethodId(1057254320151351478L).languageId(0x938bae8e3fac20aaL, 0x2405a196e75d462cL).build2();
  public static final SMethod<SNode> getFunctionReturnType_idUG7NftRy8a = new SMethodBuilder<SNode>(new SJavaCompoundTypeImpl((Class<SNode>) ((Class) Object.class))).name("getFunctionReturnType").modifiers(8, AccessPrivileges.PUBLIC).concept(CONCEPT).baseMethodId(1057254320151339530L).languageId(0x938bae8e3fac20aaL, 0x2405a196e75d462cL).build2();

  private static final List<SMethod<?>> BH_METHODS = Arrays.<SMethod<?>>asList(getReceiver_idUG7NftRxKM, getFunctionParameters_idUG7NftR_2Q, getFunctionReturnType_idUG7NftRy8a);

  private static void ___init___(@NotNull SNode __thisNode__) {
  }

  /*package*/ static SNode getReceiver_idUG7NftRxKM(@NotNull SNode __thisNode__) {
    return IOperation__BehaviorDescriptor.getOperand_idhEwIP$m.invoke(__thisNode__);
  }
  /*package*/ static Iterable<ParameterDeclaration> getFunctionParameters_idUG7NftR_2Q(@NotNull SNode __thisNode__) {
    // Single parameter -> new value
    return Sequence.<ParameterDeclaration>singleton(new PropertySetterParameterDeclaration(SLinkOperations.getTarget(__thisNode__, LINKS.target$7dy6)));
  }
  /*package*/ static SNode getFunctionReturnType_idUG7NftRy8a(@NotNull SNode __thisNode__) {
    // Returns void (well it's a setter)
    return SConceptOperations.createNewNode(MetaAdapterFactory.getConcept(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc6bf96dL, "jetbrains.mps.baseLanguage.structure.VoidType"));
  }

  /*package*/ KotlinPropertySetterCall__BehaviorDescriptor() {
  }

  @Override
  protected void initNode(@NotNull SNode node, @NotNull SConstructor constructor, @Nullable Object[] parameters) {
    ___init___(node);
  }

  @Override
  protected <T> T invokeSpecial0(@NotNull SNode node, @NotNull SMethod<T> method, @Nullable Object[] parameters) {
    int methodIndex = BH_METHODS.indexOf(method);
    if (methodIndex < 0) {
      throw new BHMethodNotFoundException(this, method);
    }
    switch (methodIndex) {
      case 0:
        return (T) ((SNode) getReceiver_idUG7NftRxKM(node));
      case 1:
        return (T) ((Iterable<ParameterDeclaration>) getFunctionParameters_idUG7NftR_2Q(node));
      case 2:
        return (T) ((SNode) getFunctionReturnType_idUG7NftRy8a(node));
      default:
        throw new BHMethodNotFoundException(this, method);
    }
  }

  @Override
  protected <T> T invokeSpecial0(@NotNull SAbstractConcept concept, @NotNull SMethod<T> method, @Nullable Object[] parameters) {
    int methodIndex = BH_METHODS.indexOf(method);
    if (methodIndex < 0) {
      throw new BHMethodNotFoundException(this, method);
    }
    switch (methodIndex) {
      default:
        throw new BHMethodNotFoundException(this, method);
    }
  }

  @NotNull
  @Override
  public List<SMethod<?>> getDeclaredMethods() {
    return BH_METHODS;
  }

  @NotNull
  @Override
  public SAbstractConcept getConcept() {
    return CONCEPT;
  }

  private static final class LINKS {
    /*package*/ static final SReferenceLink target$7dy6 = MetaAdapterFactory.getReferenceLink(0x2405a196e75d462cL, 0x938bae8e3fac20aaL, 0xeac1f33ddc380f3L, 0xf8c78301adL, "target");
  }
}
