All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ai.stapi.graphsystem.genericGraphEventFactory.exception.GenericGraphEventFactoryException Maven / Gradle / Ivy

package ai.stapi.graphsystem.genericGraphEventFactory.exception;

import ai.stapi.graphsystem.messaging.event.AggregateGraphUpdatedEvent;

public class GenericGraphEventFactoryException extends RuntimeException {

  private GenericGraphEventFactoryException(String message) {
    super(message);
  }

  public static GenericGraphEventFactoryException becauseNoSupportingSpecificFactoriesForGivenEvent(
      Class event
  ) {
    return new GenericGraphEventFactoryException(
        "There are no supporting factories for event '" + event.getSimpleName() + "'."
    );
  }

  public static GenericGraphEventFactoryException becauseMoreThanOneSpecificFactoriesForGivenCommand(
      Class event) {
    return new GenericGraphEventFactoryException(
        "There are multiple supporting factories for event '"
            + event.getSimpleName()
            + "' and that is not allowed."
    );
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy