package jetbrains.mps.lang.smodelTests.structure;

/*Generated by MPS */

import jetbrains.mps.smodel.runtime.EnumerationDescriptorBase;
import jetbrains.mps.smodel.runtime.EnumerationDescriptor;
import jetbrains.mps.lang.smodel.EnumerationLiteralsIndex;
import java.util.List;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.NotNull;

public class EnumerationDescriptor_TestEnum_Switch extends EnumerationDescriptorBase {

  public EnumerationDescriptor_TestEnum_Switch() {
    super(0xb02ae39f4c164545L, 0x8dfa88df16804e7eL, 0x6eb821113ba9c112L, "TestEnum_Switch", "r:43b4d418-d4ca-4d97-ab07-31e4f3ddb3e5(jetbrains.mps.lang.smodelTests.structure)/7978163097785975058");
  }

  private final EnumerationDescriptor.MemberDescriptor myMember_option1_0 = new EnumerationDescriptor.MemberDescriptor("option1", "option1", 0x6eb821113ba9c113L, "r:43b4d418-d4ca-4d97-ab07-31e4f3ddb3e5(jetbrains.mps.lang.smodelTests.structure)/7978163097785975059");
  private final EnumerationDescriptor.MemberDescriptor myMember_option2_0 = new EnumerationDescriptor.MemberDescriptor("option2", "option2", 0x6eb821113ba9c114L, "r:43b4d418-d4ca-4d97-ab07-31e4f3ddb3e5(jetbrains.mps.lang.smodelTests.structure)/7978163097785975060");
  private final EnumerationDescriptor.MemberDescriptor myMember_option3_0 = new EnumerationDescriptor.MemberDescriptor("option3", "option3", 0x6eb821113ba9c117L, "r:43b4d418-d4ca-4d97-ab07-31e4f3ddb3e5(jetbrains.mps.lang.smodelTests.structure)/7978163097785975063");

  private final EnumerationLiteralsIndex myIndex = EnumerationLiteralsIndex.build(0xb02ae39f4c164545L, 0x8dfa88df16804e7eL, 0x6eb821113ba9c112L, 0x6eb821113ba9c113L, 0x6eb821113ba9c114L, 0x6eb821113ba9c117L);
  private final List<EnumerationDescriptor.MemberDescriptor> myMembers = new EnumerationDescriptorBase.MembersList(myIndex, myMember_option1_0, myMember_option2_0, myMember_option3_0);

  @Nullable
  @Override
  public EnumerationDescriptor.MemberDescriptor getDefault() {
    return null;
  }

  @NotNull
  @Override
  public List<EnumerationDescriptor.MemberDescriptor> getMembers() {
    return myMembers;
  }

  @Nullable
  @Override
  public EnumerationDescriptor.MemberDescriptor getMember(@Nullable String memberName) {
    if (memberName == null) {
      return null;
    }
    switch (memberName) {
      case "option1":
        return myMember_option1_0;
      case "option2":
        return myMember_option2_0;
      case "option3":
        return myMember_option3_0;
    }
    return null;
  }

  @Nullable
  @Override
  public EnumerationDescriptor.MemberDescriptor getMember(long idValue) {
    int index = myIndex.index(idValue);
    if (index == -1) {
      return null;
    }
    return myMembers.get(index);
  }
}
