Class SagaRouteUtils

java.lang.Object
com.persequor.extension.frontend.SagaRouteUtils

public class SagaRouteUtils extends Object
Static method used to calculate the hash of an extension class, and to find an extension based on its hash.
  • Constructor Details

    • SagaRouteUtils

      public SagaRouteUtils()
  • Method Details

    • getExtensionHash

      public static String getExtensionHash(Class<?> extensionClass)
      This method is used by certain Saga UI/Frontend components to identify the extension class.
      Parameters:
      extensionClass - the class for which to calculate the hash
      Returns:
      the hash for the class
    • getExtensionFromHash

      public static <T> Optional<T> getExtensionFromHash(Collection<T> extensions, String extensionHash)
      Based on a list of extensions, find the one with the corresponding hash.
      Type Parameters:
      T - the type of the extension
      Parameters:
      extensions - the list of extensions to search through
      extensionHash - the hash of the extension to find (typically passed via the frontend in some way)
      Returns:
      the extension with the corresponding hash, or empty if no such extension exists