Class FacadeLocator.MockableInstance
java.lang.Object
com.sap.cloud.sdk.cloudplatform.util.FacadeLocator.MockableInstance
- Enclosing class:
- FacadeLocator
Performs the facade lookup within the
FacadeLocator
. Allows to mock the behavior of the
FacadeLocator
.
For internal use only.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<FacadeT> io.vavr.control.Try<FacadeT>
Retrieves the facade for a given interface, allowing at most one implementation to exist.<FacadeT> Collection<FacadeT>
getFacades
(Class<FacadeT> facadeInterface) Retrieves the facades for a given facade interface.
-
Constructor Details
-
MockableInstance
public MockableInstance()
-
-
Method Details
-
getFacades
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.
-