package messages.customization.feedback;

/*Generated by MPS */

import jetbrains.mps.core.aspects.feedback.api.BaseFeedbackDescriptor;
import org.jetbrains.mps.openapi.language.SAbstractConcept;
import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory;
import jetbrains.mps.core.aspects.feedback.api.FeedbackProvider;
import jetbrains.mps.core.aspects.feedback.messages.ChildCardinalityContext;
import jetbrains.mps.core.aspects.feedback.messages.BaseMessageProvider;
import jetbrains.mps.core.aspects.feedback.messages.ProblemKindId;
import jetbrains.mps.core.aspects.feedback.messages.PredefinedStructureProblemKind;
import org.jetbrains.annotations.NotNull;
import jetbrains.mps.core.aspects.feedback.messages.MessageProvider;
import java.util.List;
import java.util.Collections;
import java.util.Arrays;
import java.util.stream.Stream;

public final class CardinalityTestConcept0_FeedbackFeedback extends BaseFeedbackDescriptor {
  private static final SAbstractConcept CONCEPT = MetaAdapterFactory.getInterfaceConcept(0x7cf7c95bc81e4da9L, 0xa05645e480a7abd3L, 0x61692e8b97ee826fL, "messages.customization.structure.CardinalityTestConcept0");

  private static final FeedbackProvider<ChildCardinalityContext> MSGPROVIDER_WhenThereAreMultipleChildrenInRoleWithSingleCardinality_570te8_a = new BaseMessageProvider<ChildCardinalityContext>(new ProblemKindId(PredefinedStructureProblemKind.ONLY_ONE_CHILD_CAN_BE_IN_ROLE)) {
    @NotNull
    @Override
    public MessageProvider.Msg yieldMessage(ChildCardinalityContext context) {
      return format("Multiple children in the single role '%s':  %s!!!", context.getLink(), context.getChildren());
    }
  };

  private static final List<FeedbackProvider> PROVIDERS = Collections.unmodifiableList(Arrays.<FeedbackProvider>asList(MSGPROVIDER_WhenThereAreMultipleChildrenInRoleWithSingleCardinality_570te8_a));

  public CardinalityTestConcept0_FeedbackFeedback() {
    super(CONCEPT);
  }

  @NotNull
  @Override
  public Stream<FeedbackProvider> getDeclaredProviders() {
    return PROVIDERS.stream();
  }
}
