package declarations.structure;

/*Generated by MPS */

import jetbrains.mps.smodel.runtime.BaseStructureAspectDescriptor;
import jetbrains.mps.smodel.runtime.ConceptDescriptor;
import java.util.Collection;
import java.util.Arrays;
import org.jetbrains.annotations.Nullable;
import jetbrains.mps.smodel.adapter.ids.SConceptId;
import org.jetbrains.mps.openapi.language.SAbstractConcept;
import jetbrains.mps.smodel.runtime.impl.ConceptDescriptorBuilder2;

public class StructureAspectDescriptor extends BaseStructureAspectDescriptor {
  /*package*/ final ConceptDescriptor myConceptNewComponent = createDescriptorForNewComponent();
  /*package*/ final ConceptDescriptor myConceptNewComponentMember = createDescriptorForNewComponentMember();
  /*package*/ final ConceptDescriptor myConceptOldComponent = createDescriptorForOldComponent();
  /*package*/ final ConceptDescriptor myConceptOldComponentMember = createDescriptorForOldComponentMember();
  private final LanguageConceptSwitch myIndexSwitch;

  public StructureAspectDescriptor() {
    myIndexSwitch = new LanguageConceptSwitch();
  }


  @Override
  public void reportDependencies(jetbrains.mps.smodel.runtime.StructureAspectDescriptor.Dependencies deps) {
    deps.extendedLanguage(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, "jetbrains.mps.lang.core");
  }

  @Override
  public Collection<ConceptDescriptor> getDescriptors() {
    return Arrays.asList(myConceptNewComponent, myConceptNewComponentMember, myConceptOldComponent, myConceptOldComponentMember);
  }

  @Override
  @Nullable
  public ConceptDescriptor getDescriptor(SConceptId id) {
    switch (myIndexSwitch.index(id)) {
      case LanguageConceptSwitch.NewComponent:
        return myConceptNewComponent;
      case LanguageConceptSwitch.NewComponentMember:
        return myConceptNewComponentMember;
      case LanguageConceptSwitch.OldComponent:
        return myConceptOldComponent;
      case LanguageConceptSwitch.OldComponentMember:
        return myConceptOldComponentMember;
      default:
        return null;
    }
  }


  /*package*/ int internalIndex(SAbstractConcept c) {
    return myIndexSwitch.index(c);
  }

  private static ConceptDescriptor createDescriptorForNewComponent() {
    ConceptDescriptorBuilder2 b = new ConceptDescriptorBuilder2("declarations", "NewComponent", 0x1d2b03a474044a1eL, 0x939c9c1c316327e7L, 0x6aff2c1049329d71L);
    b.class_(false, false, true);
    b.parent(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L);
    b.origin("r:8ded2ed4-9c33-4e5f-8484-5e54968f4d4e(declarations.structure)/7709929535540731249");
    b.version(3);
    b.aggregate("member", 0x6aff2c1049329d74L).target(0x1d2b03a474044a1eL, 0x939c9c1c316327e7L, 0x6aff2c104932a602L).optional(true).ordered(true).multiple(true).origin("7709929535540731252").done();
    b.alias("new component");
    return b.create();
  }
  private static ConceptDescriptor createDescriptorForNewComponentMember() {
    ConceptDescriptorBuilder2 b = new ConceptDescriptorBuilder2("declarations", "NewComponentMember", 0x1d2b03a474044a1eL, 0x939c9c1c316327e7L, 0x6aff2c104932a602L);
    b.interface_();
    b.origin("r:8ded2ed4-9c33-4e5f-8484-5e54968f4d4e(declarations.structure)/7709929535540733442");
    b.version(3);
    return b.create();
  }
  private static ConceptDescriptor createDescriptorForOldComponent() {
    ConceptDescriptorBuilder2 b = new ConceptDescriptorBuilder2("declarations", "OldComponent", 0x1d2b03a474044a1eL, 0x939c9c1c316327e7L, 0x6aff2c1049316cdaL);
    b.class_(false, false, true);
    b.parent(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L);
    b.origin("r:8ded2ed4-9c33-4e5f-8484-5e54968f4d4e(declarations.structure)/7709929535540653274");
    b.version(3);
    b.aggregate("member", 0x6aff2c104931bb27L).target(0x1d2b03a474044a1eL, 0x939c9c1c316327e7L, 0x6aff2c104931bb26L).optional(true).ordered(true).multiple(true).origin("7709929535540673319").done();
    b.alias("old component");
    return b.create();
  }
  private static ConceptDescriptor createDescriptorForOldComponentMember() {
    ConceptDescriptorBuilder2 b = new ConceptDescriptorBuilder2("declarations", "OldComponentMember", 0x1d2b03a474044a1eL, 0x939c9c1c316327e7L, 0x6aff2c104931bb26L);
    b.interface_();
    b.origin("r:8ded2ed4-9c33-4e5f-8484-5e54968f4d4e(declarations.structure)/7709929535540673318");
    b.version(3);
    return b.create();
  }
}
