package jetbrains.mps.execution.commands.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 jetbrains.mps.core.aspects.behaviour.SMethodBuilder;
import jetbrains.mps.core.aspects.behaviour.SJavaCompoundTypeImpl;
import jetbrains.mps.core.aspects.behaviour.AccessPrivileges;
import org.jetbrains.mps.openapi.model.SNode;
import java.util.List;
import java.util.Arrays;
import org.jetbrains.annotations.NotNull;
import jetbrains.mps.lang.smodel.generator.smodelAdapter.SNodeOperations;
import jetbrains.mps.lang.smodel.generator.smodelAdapter.SLinkOperations;
import jetbrains.mps.lang.smodel.generator.smodelAdapter.SPropertyOperations;
import jetbrains.mps.execution.common.behavior.IGeneratedToClass__BehaviorDescriptor;
import jetbrains.mps.lang.core.behavior.BaseConcept__BehaviorDescriptor;
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.SConcept;
import org.jetbrains.mps.openapi.language.SInterfaceConcept;
import org.jetbrains.mps.openapi.language.SContainmentLink;
import org.jetbrains.mps.openapi.language.SProperty;

public final class CommandParameterDeclaration__BehaviorDescriptor extends BaseBHDescriptor {
  private static final SAbstractConcept CONCEPT = MetaAdapterFactory.getConcept(0xf3347d8a0e794f35L, 0x8ac91574f25c986fL, 0x65afee7b2c712158L, "jetbrains.mps.execution.commands.structure.CommandParameterDeclaration");

  public static final SMethod<Boolean> isRequired_id7c4O8d8q0tV = new SMethodBuilder<Boolean>(new SJavaCompoundTypeImpl(Boolean.TYPE)).name("isRequired").modifiers(8, AccessPrivileges.PUBLIC).concept(CONCEPT).baseMethodId(8287978476542625659L).languageId(0x8ac91574f25c986fL, 0xf3347d8a0e794f35L).build2();
  public static final SMethod<Boolean> generateField_id7mEQKPeolUk = new SMethodBuilder<Boolean>(new SJavaCompoundTypeImpl(Boolean.TYPE)).name("generateField").modifiers(8, AccessPrivileges.PUBLIC).concept(CONCEPT).baseMethodId(8478830098674441876L).languageId(0x8ac91574f25c986fL, 0xf3347d8a0e794f35L).build2();
  public static final SMethod<String> getSetterName_id6mJVBGGsi5s = new SMethodBuilder<String>(new SJavaCompoundTypeImpl(String.class)).name("getSetterName").modifiers(0, AccessPrivileges.PUBLIC).concept(CONCEPT).baseMethodId(7327337331549086044L).languageId(0x8ac91574f25c986fL, 0xf3347d8a0e794f35L).build2();
  public static final SMethod<String> getSetterLongName_id3gpm$NHlR8F = new SMethodBuilder<String>(new SJavaCompoundTypeImpl(String.class)).name("getSetterLongName").modifiers(0, AccessPrivileges.PUBLIC).concept(CONCEPT).baseMethodId(3754131050835964459L).languageId(0x8ac91574f25c986fL, 0xf3347d8a0e794f35L).build2();
  /*package*/ static final SMethod<String> getUpperCaseName_id6mJVBGGsi5H = new SMethodBuilder<String>(new SJavaCompoundTypeImpl(String.class)).name("getUpperCaseName").modifiers(0, AccessPrivileges.PRIVATE).concept(CONCEPT).baseMethodId(7327337331549086061L).languageId(0x8ac91574f25c986fL, 0xf3347d8a0e794f35L).build2();
  public static final SMethod<String> getFieldName_id6mJVBGGspQq = new SMethodBuilder<String>(new SJavaCompoundTypeImpl(String.class)).name("getFieldName").modifiers(0, AccessPrivileges.PUBLIC).concept(CONCEPT).baseMethodId(7327337331549117850L).languageId(0x8ac91574f25c986fL, 0xf3347d8a0e794f35L).build2();
  public static final SMethod<String> getFieldName_id6mJVBGGsi69 = new SMethodBuilder<String>(new SJavaCompoundTypeImpl(String.class)).name("getFieldName").modifiers(1, AccessPrivileges.PUBLIC).concept(CONCEPT).baseMethodId(7327337331549086089L).languageId(0x8ac91574f25c986fL, 0xf3347d8a0e794f35L).build2(SMethodBuilder.createJavaParameter(String.class, ""));
  public static final SMethod<String> getTypeSuffix_id3gpm$NHlXW7 = new SMethodBuilder<String>(new SJavaCompoundTypeImpl(String.class)).name("getTypeSuffix").modifiers(1, AccessPrivileges.PUBLIC).concept(CONCEPT).baseMethodId(3754131050835992327L).languageId(0x8ac91574f25c986fL, 0xf3347d8a0e794f35L).build2(SMethodBuilder.createJavaParameter((Class<SNode>) ((Class) Object.class), ""));
  public static final SMethod<String> getUpperCaseName_id6mJVBGGsi5Q = new SMethodBuilder<String>(new SJavaCompoundTypeImpl(String.class)).name("getUpperCaseName").modifiers(1, AccessPrivileges.PUBLIC).concept(CONCEPT).baseMethodId(7327337331549086070L).languageId(0x8ac91574f25c986fL, 0xf3347d8a0e794f35L).build2(SMethodBuilder.createJavaParameter(String.class, ""));

  private static final List<SMethod<?>> BH_METHODS = Arrays.<SMethod<?>>asList(isRequired_id7c4O8d8q0tV, generateField_id7mEQKPeolUk, getSetterName_id6mJVBGGsi5s, getSetterLongName_id3gpm$NHlR8F, getUpperCaseName_id6mJVBGGsi5H, getFieldName_id6mJVBGGspQq, getFieldName_id6mJVBGGsi69, getTypeSuffix_id3gpm$NHlXW7, getUpperCaseName_id6mJVBGGsi5Q);

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

  /*package*/ static boolean isRequired_id7c4O8d8q0tV(@NotNull SNode __thisNode__) {
    return false;
  }
  /*package*/ static boolean generateField_id7mEQKPeolUk(@NotNull SNode __thisNode__) {
    return true;
  }
  /*package*/ static String getSetterName_id6mJVBGGsi5s(@NotNull SNode __thisNode__) {
    return "set" + CommandParameterDeclaration__BehaviorDescriptor.getUpperCaseName_id6mJVBGGsi5H.invokeSpecial(__thisNode__);
  }
  /*package*/ static String getSetterLongName_id3gpm$NHlR8F(@NotNull SNode __thisNode__) {
    return CommandParameterDeclaration__BehaviorDescriptor.getSetterName_id6mJVBGGsi5s.invoke(__thisNode__) + "_" + CommandParameterDeclaration__BehaviorDescriptor.getTypeSuffix_id3gpm$NHlXW7.invoke(SNodeOperations.asSConcept(CONCEPTS.CommandParameterDeclaration$BK), SLinkOperations.getTarget(__thisNode__, LINKS.type$a1UY));
  }
  /*package*/ static String getUpperCaseName_id6mJVBGGsi5H(@NotNull SNode __thisNode__) {
    return (String) CommandParameterDeclaration__BehaviorDescriptor.getUpperCaseName_id6mJVBGGsi5Q.invoke(SNodeOperations.asSConcept(CONCEPTS.CommandParameterDeclaration$BK), SPropertyOperations.getString(__thisNode__, PROPS.name$MnvL));
  }
  /*package*/ static String getFieldName_id6mJVBGGspQq(@NotNull SNode __thisNode__) {
    return CommandParameterDeclaration__BehaviorDescriptor.getFieldName_id6mJVBGGsi69.invoke(SNodeOperations.asSConcept(CONCEPTS.CommandParameterDeclaration$BK), SPropertyOperations.getString(__thisNode__, PROPS.name$MnvL)) + "_" + CommandParameterDeclaration__BehaviorDescriptor.getTypeSuffix_id3gpm$NHlXW7.invoke(SNodeOperations.asSConcept(CONCEPTS.CommandParameterDeclaration$BK), SLinkOperations.getTarget(__thisNode__, LINKS.type$a1UY));
  }
  /*package*/ static String getFieldName_id6mJVBGGsi69(@NotNull SAbstractConcept __thisConcept__, String name) {
    return "my" + CommandParameterDeclaration__BehaviorDescriptor.getUpperCaseName_id6mJVBGGsi5Q.invoke(SNodeOperations.asSConcept(CONCEPTS.CommandParameterDeclaration$BK), name);
  }
  /*package*/ static String getTypeSuffix_id3gpm$NHlXW7(@NotNull SAbstractConcept __thisConcept__, SNode type) {
    return IGeneratedToClass__BehaviorDescriptor.getValidClassName_id3gpm$NHlLi1.invoke(SNodeOperations.asSConcept(CONCEPTS.IGeneratedToClass$Cg), BaseConcept__BehaviorDescriptor.getPresentation_idhEwIMiw.invoke(type));
  }
  /*package*/ static String getUpperCaseName_id6mJVBGGsi5Q(@NotNull SAbstractConcept __thisConcept__, String name) {
    return name.substring(0, 1).toUpperCase() + name.substring(1);
  }

  /*package*/ CommandParameterDeclaration__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) ((Boolean) isRequired_id7c4O8d8q0tV(node));
      case 1:
        return (T) ((Boolean) generateField_id7mEQKPeolUk(node));
      case 2:
        return (T) ((String) getSetterName_id6mJVBGGsi5s(node));
      case 3:
        return (T) ((String) getSetterLongName_id3gpm$NHlR8F(node));
      case 4:
        return (T) ((String) getUpperCaseName_id6mJVBGGsi5H(node));
      case 5:
        return (T) ((String) getFieldName_id6mJVBGGspQq(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) {
      case 6:
        return (T) ((String) getFieldName_id6mJVBGGsi69(concept, (String) parameters[0]));
      case 7:
        return (T) ((String) getTypeSuffix_id3gpm$NHlXW7(concept, (SNode) parameters[0]));
      case 8:
        return (T) ((String) getUpperCaseName_id6mJVBGGsi5Q(concept, (String) parameters[0]));
      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 CONCEPTS {
    /*package*/ static final SConcept CommandParameterDeclaration$BK = MetaAdapterFactory.getConcept(0xf3347d8a0e794f35L, 0x8ac91574f25c986fL, 0x65afee7b2c712158L, "jetbrains.mps.execution.commands.structure.CommandParameterDeclaration");
    /*package*/ static final SInterfaceConcept IGeneratedToClass$Cg = MetaAdapterFactory.getInterfaceConcept(0x73c1a49099fa4d0dL, 0x8292b8985697c74bL, 0xd244b712f9dcdabL, "jetbrains.mps.execution.common.structure.IGeneratedToClass");
  }

  private static final class LINKS {
    /*package*/ static final SContainmentLink type$a1UY = MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x450368d90ce15bc3L, 0x4ed4d318133c80ceL, "type");
  }

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