Class FacadeLocator.MockableInstance

java.lang.Object
com.sap.cloud.sdk.cloudplatform.util.FacadeLocator.MockableInstance
Enclosing class:
FacadeLocator

public static class FacadeLocator.MockableInstance extends Object
Performs the facade lookup within the FacadeLocator. Allows to mock the behavior of the FacadeLocator.

For internal use only.

  • Constructor Details

    • MockableInstance

      public MockableInstance()
  • Method Details

    • getFacades

      @Nonnull public <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 <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.