package jetbrains.mps.build.mps.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 jetbrains.mps.build.util.MacroHelper;
import java.util.List;
import java.util.Arrays;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.mps.openapi.model.SNode;
import jetbrains.mps.build.behavior.BuildString__BehaviorDescriptor;
import jetbrains.mps.lang.smodel.generator.smodelAdapter.SLinkOperations;
import jetbrains.mps.lang.smodel.generator.smodelAdapter.SPropertyOperations;
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.SContainmentLink;
import org.jetbrains.mps.openapi.language.SProperty;

public final class BuildMps_Branding__BehaviorDescriptor extends BaseBHDescriptor {
  private static final SAbstractConcept CONCEPT = MetaAdapterFactory.getConcept(0xcf935df46994e9cL, 0xa132fa109541cba3L, 0x6b9a2011083b778dL, "jetbrains.mps.build.mps.structure.BuildMps_Branding");

  public static final SMethod<String> getVersionMajor_id3AMbuf0qvyc = new SMethodBuilder<String>(new SJavaCompoundTypeImpl(String.class)).name("getVersionMajor").modifiers(0, AccessPrivileges.PUBLIC).concept(CONCEPT).baseMethodId(4157435862225385612L).languageId(0xa132fa109541cba3L, 0xcf935df46994e9cL).build2(SMethodBuilder.createJavaParameter(MacroHelper.class, ""));
  public static final SMethod<String> getVersionMinor_id3AMbuf0qHKA = new SMethodBuilder<String>(new SJavaCompoundTypeImpl(String.class)).name("getVersionMinor").modifiers(0, AccessPrivileges.PUBLIC).concept(CONCEPT).baseMethodId(4157435862225443878L).languageId(0xa132fa109541cba3L, 0xcf935df46994e9cL).build2(SMethodBuilder.createJavaParameter(MacroHelper.class, ""));
  public static final SMethod<String> getVersionBugfixNr_id3AMbuf3$r6x = new SMethodBuilder<String>(new SJavaCompoundTypeImpl(String.class)).name("getVersionBugfixNr").modifiers(0, AccessPrivileges.PUBLIC).concept(CONCEPT).baseMethodId(4157435862278320545L).languageId(0xa132fa109541cba3L, 0xcf935df46994e9cL).build2(SMethodBuilder.createJavaParameter(MacroHelper.class, ""));
  public static final SMethod<String> getVersionEap_id3AMbuf0qQ5F = new SMethodBuilder<String>(new SJavaCompoundTypeImpl(String.class)).name("getVersionEap").modifiers(0, AccessPrivileges.PUBLIC).concept(CONCEPT).baseMethodId(4157435862225477995L).languageId(0xa132fa109541cba3L, 0xcf935df46994e9cL).build2(SMethodBuilder.createJavaParameter(MacroHelper.class, ""));
  public static final SMethod<Boolean> isNewVersionFormat_id3AMbuf0qvWw = new SMethodBuilder<Boolean>(new SJavaCompoundTypeImpl(Boolean.TYPE)).name("isNewVersionFormat").modifiers(0, AccessPrivileges.PUBLIC).concept(CONCEPT).baseMethodId(4157435862225387296L).languageId(0xa132fa109541cba3L, 0xcf935df46994e9cL).build2();

  private static final List<SMethod<?>> BH_METHODS = Arrays.<SMethod<?>>asList(getVersionMajor_id3AMbuf0qvyc, getVersionMinor_id3AMbuf0qHKA, getVersionBugfixNr_id3AMbuf3$r6x, getVersionEap_id3AMbuf0qQ5F, isNewVersionFormat_id3AMbuf0qvWw);

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

  /*package*/ static String getVersionMajor_id3AMbuf0qvyc(@NotNull SNode __thisNode__, MacroHelper helper) {
    return (((boolean) BuildMps_Branding__BehaviorDescriptor.isNewVersionFormat_id3AMbuf0qvWw.invoke(__thisNode__)) ? BuildString__BehaviorDescriptor.getText_id3NagsOfTioI.invoke(SLinkOperations.getTarget(SLinkOperations.getTarget(__thisNode__, LINKS.version$1QyI), LINKS.versionMajor$uCbh), helper) : SPropertyOperations.getInteger(__thisNode__, PROPS.major$o5cB) + "");
  }
  /*package*/ static String getVersionMinor_id3AMbuf0qHKA(@NotNull SNode __thisNode__, MacroHelper helper) {
    return (((boolean) BuildMps_Branding__BehaviorDescriptor.isNewVersionFormat_id3AMbuf0qvWw.invoke(__thisNode__)) ? BuildString__BehaviorDescriptor.getText_id3NagsOfTioI.invoke(SLinkOperations.getTarget(SLinkOperations.getTarget(__thisNode__, LINKS.version$1QyI), LINKS.versionMinor$uCqi), helper) : SPropertyOperations.getInteger(__thisNode__, PROPS.minor$o5rC) + "");
  }
  /*package*/ static String getVersionBugfixNr_id3AMbuf3$r6x(@NotNull SNode __thisNode__, MacroHelper helper) {
    return (((boolean) BuildMps_Branding__BehaviorDescriptor.isNewVersionFormat_id3AMbuf0qvWw.invoke(__thisNode__)) ? BuildString__BehaviorDescriptor.getText_id3NagsOfTioI.invoke(SLinkOperations.getTarget(SLinkOperations.getTarget(__thisNode__, LINKS.version$1QyI), LINKS.versionBugfixNr$uCDj), helper) : ((isNotEmptyString(SPropertyOperations.getString(__thisNode__, PROPS.bugfixNr$3lSO)) ? "." + SPropertyOperations.getString(__thisNode__, PROPS.bugfixNr$3lSO) : "")));
  }
  /*package*/ static String getVersionEap_id3AMbuf0qQ5F(@NotNull SNode __thisNode__, MacroHelper helper) {
    return (((boolean) BuildMps_Branding__BehaviorDescriptor.isNewVersionFormat_id3AMbuf0qvWw.invoke(__thisNode__)) ? BuildString__BehaviorDescriptor.getText_id3NagsOfTioI.invoke(SLinkOperations.getTarget(SLinkOperations.getTarget(__thisNode__, LINKS.version$1QyI), LINKS.versionEap$uCSk), helper) : ((SPropertyOperations.getBoolean(__thisNode__, PROPS.eap$o5ED) ? " EAP" : "")));
  }
  /*package*/ static boolean isNewVersionFormat_id3AMbuf0qvWw(@NotNull SNode __thisNode__) {
    return (SLinkOperations.getTarget(__thisNode__, LINKS.version$1QyI) != null);
  }

  /*package*/ BuildMps_Branding__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) ((String) getVersionMajor_id3AMbuf0qvyc(node, (MacroHelper) parameters[0]));
      case 1:
        return (T) ((String) getVersionMinor_id3AMbuf0qHKA(node, (MacroHelper) parameters[0]));
      case 2:
        return (T) ((String) getVersionBugfixNr_id3AMbuf3$r6x(node, (MacroHelper) parameters[0]));
      case 3:
        return (T) ((String) getVersionEap_id3AMbuf0qQ5F(node, (MacroHelper) parameters[0]));
      case 4:
        return (T) ((Boolean) isNewVersionFormat_id3AMbuf0qvWw(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 boolean isNotEmptyString(String str) {
    return str != null && str.length() > 0;
  }

  private static final class LINKS {
    /*package*/ static final SContainmentLink version$1QyI = MetaAdapterFactory.getContainmentLink(0xcf935df46994e9cL, 0xa132fa109541cba3L, 0x6b9a2011083b778dL, 0x39b22de3c628a4d9L, "version");
    /*package*/ static final SContainmentLink versionMajor$uCbh = MetaAdapterFactory.getContainmentLink(0xcf935df46994e9cL, 0xa132fa109541cba3L, 0x39b22de3c6289d84L, 0x39b22de3c6289d9fL, "versionMajor");
    /*package*/ static final SContainmentLink versionMinor$uCqi = MetaAdapterFactory.getContainmentLink(0xcf935df46994e9cL, 0xa132fa109541cba3L, 0x39b22de3c6289d84L, 0x39b22de3c6289da0L, "versionMinor");
    /*package*/ static final SContainmentLink versionBugfixNr$uCDj = MetaAdapterFactory.getContainmentLink(0xcf935df46994e9cL, 0xa132fa109541cba3L, 0x39b22de3c6289d84L, 0x39b22de3c6289da1L, "versionBugfixNr");
    /*package*/ static final SContainmentLink versionEap$uCSk = MetaAdapterFactory.getContainmentLink(0xcf935df46994e9cL, 0xa132fa109541cba3L, 0x39b22de3c6289d84L, 0x39b22de3c6289da2L, "versionEap");
  }

  private static final class PROPS {
    /*package*/ static final SProperty major$o5cB = MetaAdapterFactory.getProperty(0xcf935df46994e9cL, 0xa132fa109541cba3L, 0x6b9a2011083b778dL, 0x308857b584c74e44L, "major");
    /*package*/ static final SProperty minor$o5rC = MetaAdapterFactory.getProperty(0xcf935df46994e9cL, 0xa132fa109541cba3L, 0x6b9a2011083b778dL, 0x308857b584c74e45L, "minor");
    /*package*/ static final SProperty bugfixNr$3lSO = MetaAdapterFactory.getProperty(0xcf935df46994e9cL, 0xa132fa109541cba3L, 0x6b9a2011083b778dL, 0x3acf8ab06f017071L, "bugfixNr");
    /*package*/ static final SProperty eap$o5ED = MetaAdapterFactory.getProperty(0xcf935df46994e9cL, 0xa132fa109541cba3L, 0x6b9a2011083b778dL, 0x308857b584c74e46L, "eap");
  }
}
