Class FacadeLocator

java.lang.Object
com.sap.cloud.sdk.cloudplatform.util.FacadeLocator

public class FacadeLocator extends Object
This class is for internal use only. It determines facades that are used to abstract certain logic, e.g., to adjust to different platform services based on the current Cloud platform.
  • Constructor Details

    • FacadeLocator

      public FacadeLocator()
  • Method Details

    • getMockableInstance

      @Nonnull public static FacadeLocator.MockableInstance getMockableInstance()
      Returns the current FacadeLocator.MockableInstance.

      For internal use only.

      Returns:
      The current FacadeLocator.MockableInstance.
    • setMockableInstance

      public static void setMockableInstance(@Nonnull FacadeLocator.MockableInstance mockableInstance)
      Replaces the default FacadeLocator.MockableInstance.

      For internal use only.

      Parameters:
      mockableInstance - The mockable instance.
    • getFacades

      @Nonnull public static <FacadeT> Collection<FacadeT> getFacades(@Nonnull Class<FacadeT> facadeInterface)
      Retrieves the facades for a given facade interface.

      For internal use only.

      Type Parameters:
      FacadeT - The generic facade type.
      Parameters:
      facadeInterface - The facade interface for which implementations should be located.
      Returns:
      A collection of all instances of the class that implement the facade interface.
    • getFacade

      @Nonnull public static <FacadeT> io.vavr.control.Try<FacadeT> getFacade(@Nonnull Class<FacadeT> facadeInterface)
      Retrieves the facade for a given interface, allowing at most one implementation to exist. Considered to fail if there is more than one facade.

      For internal use only.

      Type Parameters:
      FacadeT - The generic facade type.
      Parameters:
      facadeInterface - The facade interface for which an implementation should be located.
      Returns:
      A Try of the instance of the class that implements the facade interface.